feat: show message that user can't message another

This commit is contained in:
Paul Makles 2022-07-14 15:06:37 +01:00
parent fc8cfa5419
commit df1b39256d
2 changed files with 21 additions and 9 deletions

View file

@ -628,14 +628,26 @@ export default function ContextMenus() {
}); });
} }
if ( if (user._id !== userId) {
user._id !== userId && if (userPermissions & UserPermission.SendMessage) {
userPermissions & UserPermission.SendMessage
) {
generateAction({ generateAction({
action: "message_user", action: "message_user",
user, user,
}); });
} else {
elements.push(
<MenuItem disabled={true}>
<Tooltip
content="Must be friends with this user to message them."
placement="left"
hideOnClick={false}>
<Text
id={`app.context_menu.message_user`}
/>
</Tooltip>
</MenuItem>,
);
}
} }
for (let i = 0; i < actions.length; i++) { for (let i = 0; i < actions.length; i++) {

View file

@ -1,5 +1,5 @@
.preact-context-menu .context-menu { .preact-context-menu .context-menu {
z-index: 10000; z-index: 9998;
min-width: 190px; min-width: 190px;
font-weight: 500; font-weight: 500;
padding: 6px 8px; padding: 6px 8px;