Merge pull request #40 from archem-team/feat/pin_message

disallow user to pin
pull/1154/head
teamabron 2025-02-06 11:36:52 +03:30 committed by GitHub
commit 25a5eef565
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 6 deletions

View File

@ -93,7 +93,7 @@ export const PinMessageBox = observer(
let children = null;
let userName = message.client ? message.client.user?.username : ""
let userName = message.client ? message.system.by_username : ""
if (data.type as string == "message_pinned") {

View File

@ -857,9 +857,7 @@ export default function ContextMenus() {
action: "mark_unread",
message,
});
if (sendPermission) {
if (channelPermissions & Permission.ManageMessages) {
if (message.is_pinned && channel?.channel_type != "DirectMessage") {
generateAction({
action: "unpin_message",

View File

@ -164,8 +164,6 @@ export default observer(({ last_id, renderer, highlight }: Props) => {
previous.masquerade,
);
}
// console.log(renderer.messages[i].content, 7979)
if (message.system?.type as any == "message_pinned" || message.system?.type as any == "message_unpinned") {
render.push(