44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
// Module ID: 11012
|
|
// Function ID: 11013
|
|
// Name: isMessagePinnable
|
|
// Dependencies: [3883, 676, 5784, 5783, 2]
|
|
// Exports: default
|
|
|
|
// Module 11012 (isMessagePinnable)
|
|
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
|
|
import ME from "ME";
|
|
|
|
let c4;
|
|
let c5;
|
|
const require = arg1;
|
|
({ ChannelTypes: c4, Permissions: c5 } = ME);
|
|
const result = require("isSystemMessage").fileFinishedImporting("modules/messages/isMessagePinnable.tsx");
|
|
|
|
export default function isMessagePinnable(arg0, isSystemDM) {
|
|
const isSystemDMResult = isSystemDM.isSystemDM();
|
|
let isActiveChannelOrUnarchivableThread = !isSystemDMResult;
|
|
if (!isSystemDMResult) {
|
|
isActiveChannelOrUnarchivableThread = !importDefault(5784)(arg0);
|
|
}
|
|
let isPrivateResult = getUncachedChannelPermissions.can(constants2.PIN_MESSAGES, isSystemDM) && getUncachedChannelPermissions.can(constants2.READ_MESSAGE_HISTORY, isSystemDM);
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
if (!isPrivateResult) {
|
|
isPrivateResult = isSystemDM.isPrivate();
|
|
}
|
|
isActiveChannelOrUnarchivableThread = isPrivateResult;
|
|
}
|
|
if (isActiveChannelOrUnarchivableThread) {
|
|
isActiveChannelOrUnarchivableThread = require(5783) /* useCanUnarchiveThread */.getIsActiveChannelOrUnarchivableThread(isSystemDM);
|
|
const obj2 = require(5783) /* useCanUnarchiveThread */;
|
|
}
|
|
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;
|
|
};
|