decord/source/modules/threads/ThreadNotificationSettings.tsx

73 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 10193
// Function ID: 10194
2026-07-20 16:05:17 +00:00
// Name: computeThreadNotificationSetting
2026-09-02 09:53:35 +00:00
// Dependencies: [1386, 4701, 4122, 1232, 673, 1398, 586, 2]
2026-07-20 16:05:17 +00:00
// Exports: useThreadNotificationSetting
2026-09-02 09:53:35 +00:00
// Module 10193 (computeThreadNotificationSetting)
import hasFlag from "hasFlag" /* 1398 */;
import closure_2 from "ensureGuildLoaded" /* 1386 */;
2026-09-01 10:26:29 +00:00
import closure_3 from "updateUserGuildSettingsInternal" /* 4701 */;
2026-09-02 09:53:35 +00:00
import closure_4 from "storeThread" /* 4122 */;
import { ThreadMemberFlags } from "AbortCodes" /* 1232 */;
import { UserNotificationSettings } from "ME" /* 673 */;
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 computeThreadNotificationSetting(channel) {
let obj = arg1;
if (arg1 === undefined) {
2026-08-24 06:08:38 +00:00
obj = closure_4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj2 = arg2;
if (arg2 === undefined) {
2026-08-24 06:08:38 +00:00
obj2 = closure_3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj3 = arg3;
if (arg3 === undefined) {
2026-08-24 06:08:38 +00:00
obj3 = closure_2;
2026-07-20 16:05:17 +00:00
}
const flagsResult = obj.flags(channel.id);
if (null == flagsResult) {
return ThreadMemberFlags.NO_MESSAGES;
} else {
if (obj6.hasFlag(flagsResult, ThreadMemberFlags.ALL_MESSAGES)) {
2026-07-29 08:29:29 +00:00
return tmp8.ALL_MESSAGES;
2026-07-20 16:05:17 +00:00
} else {
2026-09-02 09:53:35 +00:00
let tmp6Result = tmp6(1398);
2026-07-29 08:29:29 +00:00
if (tmp6Result.hasFlag(flagsResult, tmp8.ONLY_MENTIONS)) {
return tmp8.ONLY_MENTIONS;
2026-07-20 16:05:17 +00:00
} else {
2026-09-02 09:53:35 +00:00
tmp6Result = tmp6(1398);
2026-07-29 08:29:29 +00:00
if (tmp6Result.hasFlag(flagsResult, tmp8.NO_MESSAGES)) {
return tmp8.NO_MESSAGES;
2026-07-20 16:05:17 +00:00
} else {
channel = obj3.getChannel(channel.parent_id);
if (null == channel) {
2026-07-29 08:29:29 +00:00
return tmp8.NO_MESSAGES;
2026-07-20 16:05:17 +00:00
} else if (obj2.isGuildOrCategoryOrChannelMuted(channel.guild_id, channel.id)) {
2026-07-29 08:29:29 +00:00
return tmp8.NO_MESSAGES;
2026-07-20 16:05:17 +00:00
} else {
const result = obj2.resolvedMessageNotifications(channel);
if (result === UserNotificationSettings.NO_MESSAGES) {
2026-07-29 08:29:29 +00:00
let NO_MESSAGES = tmp8.NO_MESSAGES;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
NO_MESSAGES = result === tmp4.ONLY_MENTIONS ? tmp8.ONLY_MENTIONS : tmp8.ALL_MESSAGES;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return NO_MESSAGES;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-08-24 06:08:38 +00:00
obj6 = hasFlag;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/threads/ThreadNotificationSettings.tsx");
2026-07-20 16:05:17 +00:00
export { computeThreadNotificationSetting };
export const useThreadNotificationSetting = function useThreadNotificationSetting(channel) {
2026-07-23 10:11:24 +00:00
const _require = channel;
2026-08-24 06:08:38 +00:00
const items = [closure_4, closure_3, closure_2];
2026-07-20 16:05:17 +00:00
const items1 = [channel];
2026-09-02 09:53:35 +00:00
return _require(586).useStateFromStores(items, () => closure_1_7(closure_0), items1);
2026-07-20 16:05:17 +00:00
};