2026-08-24 06:08:38 +00:00
|
|
|
// Module ID: 8234
|
|
|
|
|
// Function ID: 8235
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: canReactToMessageInternal
|
2026-08-24 06:08:38 +00:00
|
|
|
// Dependencies: [1991, 4982, 4024, 1922, 676, 1403, 4013, 589, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: canReactToMessage, useCanReactToMessage
|
|
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
// Module 8234 (canReactToMessageInternal)
|
|
|
|
|
import hasFlag from "hasFlag" /* 1403 */;
|
|
|
|
|
import isCommunicationDisabled from "isCommunicationDisabled" /* 4013 */;
|
|
|
|
|
import closure_2 from "trackCommunicationDisabled" /* 1991 */;
|
|
|
|
|
import closure_3 from "recomputeGuild" /* 4982 */;
|
|
|
|
|
import closure_4 from "getUncachedChannelPermissions" /* 4024 */;
|
|
|
|
|
import closure_5 from "mergeGuildAvatar" /* 1922 */;
|
|
|
|
|
import ME from "ME" /* 676 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-08-24 06:08:38 +00:00
|
|
|
require = arg1;
|
2026-07-20 16:05:17 +00:00
|
|
|
function canReactToMessageInternal(state, getGuildId, items) {
|
|
|
|
|
[obj, obj2, obj3, obj4] = items;
|
|
|
|
|
const guildId = getGuildId.getGuildId();
|
|
|
|
|
const currentUser = obj.getCurrentUser();
|
|
|
|
|
let member = null;
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
let id;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (currentUser != null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
|
|
|
|
member = null;
|
|
|
|
|
if (null != id) {
|
|
|
|
|
member = obj2.getMember(guildId, currentUser.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let canResult = null != guildId && obj3.canChatInGuild(guildId);
|
|
|
|
|
if (canResult) {
|
|
|
|
|
canResult = obj4.can(constants.ADD_REACTIONS, getGuildId);
|
|
|
|
|
}
|
|
|
|
|
if (!canResult) {
|
|
|
|
|
canResult = getGuildId.isPrivate();
|
|
|
|
|
}
|
|
|
|
|
if (canResult) {
|
|
|
|
|
canResult = !getGuildId.isArchivedLockedThread();
|
|
|
|
|
}
|
|
|
|
|
if (canResult) {
|
|
|
|
|
canResult = state.state !== constants2.SEND_FAILED;
|
|
|
|
|
}
|
|
|
|
|
if (canResult) {
|
|
|
|
|
canResult = state.type !== constants3.THREAD_STARTER_MESSAGE;
|
|
|
|
|
}
|
|
|
|
|
if (canResult) {
|
2026-08-24 06:08:38 +00:00
|
|
|
canResult = !hasFlag.hasFlag(state.flags, constants4.EPHEMERAL);
|
|
|
|
|
const obj5 = hasFlag;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (canResult) {
|
2026-08-24 06:08:38 +00:00
|
|
|
canResult = !isCommunicationDisabled.isMemberCommunicationDisabled(member);
|
|
|
|
|
const obj6 = isCommunicationDisabled;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return canResult;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
({ Permissions: closure_6, MessageStates: error, MessageTypes: closure_8, MessageFlags: c9 } = ME);
|
|
|
|
|
const result = require("set").fileFinishedImporting("modules/reactions/canReactToMessage.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const canReactToMessage = function canReactToMessage(message, channel) {
|
2026-08-24 06:08:38 +00:00
|
|
|
const items = [closure_5, closure_2, closure_3, closure_4];
|
2026-07-20 16:05:17 +00:00
|
|
|
return canReactToMessageInternal(message, channel, items);
|
|
|
|
|
};
|
|
|
|
|
export const useCanReactToMessage = function useCanReactToMessage(arg0, arg1) {
|
2026-07-23 10:11:24 +00:00
|
|
|
const _require = arg0;
|
2026-08-24 06:08:38 +00:00
|
|
|
dependencyMap = arg1;
|
|
|
|
|
let items = [closure_5, closure_2, closure_3, closure_4];
|
2026-07-29 08:29:29 +00:00
|
|
|
return _require(589).useStateFromStores(items, () => {
|
2026-08-24 06:08:38 +00:00
|
|
|
const items = [closure_1_5, closure_1_2, closure_1_3, closure_1_4];
|
|
|
|
|
return closure_1_10(closure_0, closure_1, items);
|
2026-07-20 16:05:17 +00:00
|
|
|
});
|
|
|
|
|
};
|