46 lines
1.8 KiB
TypeScript
46 lines
1.8 KiB
TypeScript
// Module ID: 11029
|
|
// Function ID: 11030
|
|
// Name: isMessagePinnable
|
|
// Dependencies: [4472, 1086, 6689, 6688, 2]
|
|
// Exports: default
|
|
|
|
// Module 11029 (isMessagePinnable)
|
|
import ThreadHooks from "ThreadHooks" /* 6688 */;
|
|
import isSystemMessageDefault from "isSystemMessage" /* 6689 */;
|
|
import PermissionStore from "PermissionStore" /* 4472 */;
|
|
import Constants from "Constants" /* 1086 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let closure_4;
|
|
let hasOwnProperty;
|
|
({ ChannelTypes: closure_4, Permissions: hasOwnProperty } = Constants);
|
|
const result = size.fileFinishedImporting("modules/messages/isMessagePinnable.tsx");
|
|
|
|
export default function isMessagePinnable(arg0, isSystemDM) {
|
|
let isActiveChannelOrUnarchivableThread = !isSystemDM.isSystemDM();
|
|
isSystemDM.isSystemDM();
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
isActiveChannelOrUnarchivableThread = !isSystemMessageDefault(arg0);
|
|
}
|
|
let isPrivateResult = PermissionStore.can(hasOwnProperty.PIN_MESSAGES, isSystemDM) && PermissionStore.can(hasOwnProperty.READ_MESSAGE_HISTORY, isSystemDM);
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
if (!isPrivateResult) {
|
|
isPrivateResult = isSystemDM.isPrivate();
|
|
}
|
|
isActiveChannelOrUnarchivableThread = isPrivateResult;
|
|
}
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
const obj2 = ThreadHooks;
|
|
isActiveChannelOrUnarchivableThread = obj2.getIsActiveChannelOrUnarchivableThread(isSystemDM);
|
|
}
|
|
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;
|
|
};
|