add Visit Profile option to dropdown

This commit is contained in:
daria 2026-03-18 11:58:17 +02:00
parent 2899c19d0a
commit ff782f51a2
No known key found for this signature in database
GPG Key ID: 3B75240E6B2F2701

View File

@ -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);