Merge pull request #44 from archem-team/bug/unread_pinmessage

Bug/unread pinmessage
pull/1154/head
teamabron 2025-02-08 13:47:24 +03:30 committed by GitHub
commit 12b246b299
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 2 deletions

View File

@ -860,7 +860,21 @@ export default function ContextMenus() {
message,
});
if (channelPermissions & Permission.ManageMessages) {
if (message.is_pinned && channel?.channel_type != "DirectMessage") {
if (message.is_pinned) {
generateAction({
action: "unpin_message",
channel,
message
});
} else {
generateAction({
action: "pin_message",
channel,
message
});
}
} else if (message.channel?.channel_type == "DirectMessage" || message.channel?.channel_type == "Group") {
if (message.is_pinned) {
generateAction({
action: "unpin_message",
channel,
@ -873,7 +887,6 @@ export default function ContextMenus() {
message
});
}
}
if (