decord/alpha/source/modules/messages/isMessagePinnable.tsx

47 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 9656
// Function ID: 9657
2026-07-20 16:05:17 +00:00
// Name: isMessagePinnable
2026-10-09 10:00:15 +00:00
// Dependencies: [4709, 1085, 6086, 6965, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 9656 (isMessagePinnable)
import isSystemMessageDefault from "isSystemMessage" /* 6086 */;
import ThreadHooks from "ThreadHooks" /* 6965 */;
import PermissionStore from "PermissionStore" /* 4709 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let closure_4;
let hasOwnProperty;
({ ChannelTypes: closure_4, Permissions: hasOwnProperty } = Constants);
const result = size.fileFinishedImporting("modules/messages/isMessagePinnable.tsx");
2026-07-20 16:05:17 +00:00
export default function isMessagePinnable(arg0, isSystemDM) {
2026-10-03 08:58:59 +00:00
let isActiveChannelOrUnarchivableThread = !isSystemDM.isSystemDM();
isSystemDM.isSystemDM();
if (isActiveChannelOrUnarchivableThread) {
2026-08-24 06:08:38 +00:00
isActiveChannelOrUnarchivableThread = !isSystemMessageDefault(arg0);
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
let isPrivateResult = PermissionStore.can(hasOwnProperty.PIN_MESSAGES, isSystemDM) && PermissionStore.can(hasOwnProperty.READ_MESSAGE_HISTORY, isSystemDM);
2026-07-20 16:05:17 +00:00
if (isActiveChannelOrUnarchivableThread) {
2026-07-29 08:29:29 +00:00
if (!isPrivateResult) {
isPrivateResult = isSystemDM.isPrivate();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
isActiveChannelOrUnarchivableThread = isPrivateResult;
2026-07-20 16:05:17 +00:00
}
if (isActiveChannelOrUnarchivableThread) {
2026-10-03 08:58:59 +00:00
const obj2 = ThreadHooks;
isActiveChannelOrUnarchivableThread = obj2.getIsActiveChannelOrUnarchivableThread(isSystemDM);
2026-07-20 16:05:17 +00:00
}
if (isActiveChannelOrUnarchivableThread) {
isActiveChannelOrUnarchivableThread = isSystemDM.type !== constants.GUILD_VOICE;
}
if (isActiveChannelOrUnarchivableThread) {
isActiveChannelOrUnarchivableThread = isSystemDM.type !== constants.GUILD_STAGE_VOICE;
}
if (isActiveChannelOrUnarchivableThread) {
isActiveChannelOrUnarchivableThread = isSystemDM.type !== constants.MEDIA_THREAD;
}
return isActiveChannelOrUnarchivableThread;
};