decord/beta/source/modules/threads/ThreadNotificationSettings.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

107 lines
3.4 KiB
TypeScript

// Module ID: 11544
// Function ID: 11545
// Name: ThreadNotificationSettings
// Dependencies: [2045, 4939, 4401, 1118, 1078, 1389, 558, 568, 504, 2]
// Module 11544 (ThreadNotificationSettings)
import FlagUtils from "FlagUtils" /* 1389 */;
import ChannelStore from "ChannelStore" /* 2045 */;
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4939 */;
import JoinedThreadsStore from "JoinedThreadsStore" /* 4401 */;
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(1389);
}
tmp6Result = tmp6(1389);
}
obj6 = FlagUtils;
}
}
const ThreadMemberFlags = fn(1118).ThreadMemberFlags;
const UserNotificationSettings = fn(1078).UserNotificationSettings;
const ReactCompilerGating = fn(558);
const size = fn(2);
let result = size.fileFinishedImporting("modules/threads/ThreadNotificationSettings.tsx");
export { computeThreadNotificationSetting };
export const useThreadNotificationSetting = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0) => {
_require = arg0;
const cResult = require("c").c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [JoinedThreadsStore, UserGuildSettingsStore, ChannelStore];
cResult[0] = items;
let first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
class N {
constructor() {
return computeThreadNotificationSetting(closure_0);
}
}
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = N;
cResult[3] = items1;
let tmp9 = items1;
const tmp8 = N;
} else {
class N {
constructor() {
return computeThreadNotificationSetting(closure_0);
}
}
tmp9 = cResult[3];
}
const obj = require("c");
return require("initialize").useStateFromStores(first, tmp8, tmp9);
}) : ((arg0) => {
_require = arg0;
const items = [JoinedThreadsStore, UserGuildSettingsStore, ChannelStore];
const items1 = [arg0];
return require("initialize").useStateFromStores(items, () => computeThreadNotificationSetting(closure_0), items1);
});