mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 02:10:59 -05:00
feat: show message that user can't message another
This commit is contained in:
parent
fc8cfa5419
commit
df1b39256d
2 changed files with 21 additions and 9 deletions
|
@ -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++) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue