Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
// Module ID: 11159
|
|
// Function ID: 11160
|
|
// Name: isMessagePinnable
|
|
// Dependencies: [4469, 1074, 6688, 6687, 2]
|
|
// Exports: default
|
|
|
|
// Module 11159 (isMessagePinnable)
|
|
import ThreadHooks from "ThreadHooks" /* 6687 */;
|
|
import isSystemMessageDefault from "isSystemMessage" /* 6688 */;
|
|
import PermissionStore from "PermissionStore" /* 4469 */;
|
|
|
|
require = fn;
|
|
const Constants = fn(1074);
|
|
({ ChannelTypes: closure_4, Permissions: hasOwnProperty } = Constants);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/messages/isMessagePinnable.tsx");
|
|
|
|
export default function isMessagePinnable(arg0, isSystemDM) {
|
|
const isSystemDMResult = isSystemDM.isSystemDM();
|
|
let isActiveChannelOrUnarchivableThread = !isSystemDMResult;
|
|
if (!isSystemDMResult) {
|
|
isActiveChannelOrUnarchivableThread = !isSystemMessageDefault(arg0);
|
|
}
|
|
let isPrivateResult = PermissionStore.can(constants2.PIN_MESSAGES, isSystemDM) && PermissionStore.can(constants2.READ_MESSAGE_HISTORY, isSystemDM);
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
if (!isPrivateResult) {
|
|
isPrivateResult = isSystemDM.isPrivate();
|
|
}
|
|
isActiveChannelOrUnarchivableThread = isPrivateResult;
|
|
}
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
isActiveChannelOrUnarchivableThread = ThreadHooks.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;
|
|
};
|