From ff782f51a25caa26501a059e2554d2eec793f4ef Mon Sep 17 00:00:00 2001 From: daria <95225431+dariiing@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:58:17 +0200 Subject: [PATCH] add `Visit Profile` option to dropdown --- www/common/messenger-ui.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/www/common/messenger-ui.js b/www/common/messenger-ui.js index 6bf1dcd6a..d95e58b73 100644 --- a/www/common/messenger-ui.js +++ b/www/common/messenger-ui.js @@ -644,11 +644,23 @@ define([ } }; + var viewProfileOption = { + tag: 'a', + content: [Icons.get('user-profile'), h('span', Messages.userlist_visitProfile)], + action: function () { + if (friendData.profile) { window.open(origin + '/profile/#' + friendData.profile); } + return true; + } + }; + var rebuildDropdown = function (muted) { if (!$dropdown || !$dropdown.setOptions) { return; } var opts = []; if (room.isFriendChat) { opts.push(muted ? unmuteOption : muteOption); + if (friendData.profile) { + opts.push(viewProfileOption); + } opts.push(removeOption); } $dropdown.setOptions(opts); @@ -683,6 +695,9 @@ define([ if (room.isFriendChat) { dropdownOptions.push(isMuted ? unmuteOption : muteOption); + if (friendData.profile) { + dropdownOptions.push(viewProfileOption); + } dropdownOptions.push(removeOption); } @@ -733,8 +748,6 @@ define([ if (event.type === 'click' || (event.type === 'keypress' && event.which === 13)) { display(id); } - }).dblclick(function () { - if (friendData.profile) { window.open(origin + '/profile/#' + friendData.profile); } }); const $avatar = $(h('div.cp-avatar')).appendTo($room);