decord/beta/source/modules/threads/ThreadNotificationSettings.tsx
github-actions 19e52f659f chore: update source for beta 347.11
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-26 17:57:22 +00:00

75 lines
2.6 KiB
TypeScript

// Module ID: 10384
// Function ID: 10385
// Name: ThreadNotificationSettings
// Dependencies: [2041, 4969, 4429, 1114, 1074, 1385, 504, 2]
// Exports: useThreadNotificationSetting
// Module 10384 (ThreadNotificationSettings)
import FlagUtils from "FlagUtils" /* 1385 */;
import ChannelStore from "ChannelStore" /* 2041 */;
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4969 */;
import JoinedThreadsStore from "JoinedThreadsStore" /* 4429 */;
const require = globalThis.__r;
require = fn;
function computeThreadNotificationSetting(channel) {
let obj = arg1;
if (arg1 === undefined) {
obj = JoinedThreadsStore;
}
let obj2 = arg2;
if (arg2 === undefined) {
obj2 = UserGuildSettingsStore;
}
let obj3 = arg3;
if (arg3 === undefined) {
obj3 = ChannelStore;
}
const flagsResult = obj.flags(channel.id);
if (null == flagsResult) {
return ThreadMemberFlags.NO_MESSAGES;
} else {
if (obj6.hasFlag(flagsResult, ThreadMemberFlags.ALL_MESSAGES)) {
return tmp8.ALL_MESSAGES;
} else {
if (tmp6Result.hasFlag(flagsResult, tmp8.ONLY_MENTIONS)) {
return tmp8.ONLY_MENTIONS;
} else {
if (tmp6Result2.hasFlag(flagsResult, tmp8.NO_MESSAGES)) {
return tmp8.NO_MESSAGES;
} else {
channel = obj3.getChannel(channel.parent_id);
if (null == channel) {
return tmp8.NO_MESSAGES;
} else if (obj2.isGuildOrCategoryOrChannelMuted(channel.guild_id, channel.id)) {
return tmp8.NO_MESSAGES;
} else {
const result = obj2.resolvedMessageNotifications(channel);
if (result === UserNotificationSettings.NO_MESSAGES) {
let NO_MESSAGES = tmp8.NO_MESSAGES;
} else {
NO_MESSAGES = result === tmp4.ONLY_MENTIONS ? tmp8.ONLY_MENTIONS : tmp8.ALL_MESSAGES;
}
return NO_MESSAGES;
}
}
tmp6Result2 = tmp6(1385);
}
tmp6Result = tmp6(1385);
}
obj6 = FlagUtils;
}
}
const ThreadMemberFlags = fn(1114).ThreadMemberFlags;
const UserNotificationSettings = fn(1074).UserNotificationSettings;
const size = fn(2);
let result = size.fileFinishedImporting("modules/threads/ThreadNotificationSettings.tsx");
export { computeThreadNotificationSetting };
export const useThreadNotificationSetting = function useThreadNotificationSetting(channel) {
_require = channel;
const items = [JoinedThreadsStore, UserGuildSettingsStore, ChannelStore];
const items1 = [channel];
return require("initialize").useStateFromStores(items, () => computeThreadNotificationSetting(closure_0), items1);
};