Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
// Module ID: 11944
|
|
// Function ID: 11945
|
|
// Name: isMessagePinnable
|
|
// Dependencies: [4427, 1074, 7544, 7543, 2]
|
|
// Exports: default
|
|
|
|
// Module 11944 (isMessagePinnable)
|
|
import ThreadHooks from "ThreadHooks" /* 7543 */;
|
|
import isSystemMessageDefault from "isSystemMessage" /* 7544 */;
|
|
import PermissionStore from "PermissionStore" /* 4427 */;
|
|
|
|
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;
|
|
};
|