decord/source/modules/threads/ThreadNotificationSettings.tsx

74 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 10228
// Function ID: 79018
2026-07-20 16:05:17 +00:00
// Name: computeThreadNotificationSetting
2026-07-23 10:11:24 +00:00
// Dependencies: [1348, 4325, 3760, 1211, 653, 1360, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: useThreadNotificationSetting
2026-07-23 10:11:24 +00:00
// Module 10228 (computeThreadNotificationSetting)
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_3 from "_isNativeReflectConstruct";
import closure_4 from "_isNativeReflectConstruct";
import { ThreadMemberFlags } from "AbortCodes";
import { UserNotificationSettings } from "ME";
const require = arg1;
2026-07-20 16:05:17 +00:00
function computeThreadNotificationSetting(channel) {
let obj = arg1;
let obj2 = arg2;
let obj3 = arg3;
if (arg1 === undefined) {
obj = closure_4;
}
if (obj2 === undefined) {
obj2 = closure_3;
}
if (obj3 === undefined) {
2026-07-23 10:11:24 +00:00
obj3 = _isNativeReflectConstruct;
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)) {
return ThreadMemberFlags.ALL_MESSAGES;
} else {
if (obj4.hasFlag(flagsResult, ThreadMemberFlags.ONLY_MENTIONS)) {
return ThreadMemberFlags.ONLY_MENTIONS;
} else {
if (obj5.hasFlag(flagsResult, ThreadMemberFlags.NO_MESSAGES)) {
return ThreadMemberFlags.NO_MESSAGES;
} else {
channel = obj3.getChannel(channel.parent_id);
if (null == channel) {
return ThreadMemberFlags.NO_MESSAGES;
} else if (obj2.isGuildOrCategoryOrChannelMuted(channel.guild_id, channel.id)) {
return ThreadMemberFlags.NO_MESSAGES;
} else {
const result = obj2.resolvedMessageNotifications(channel);
if (result === UserNotificationSettings.NO_MESSAGES) {
let ALL_MESSAGES = ThreadMemberFlags.NO_MESSAGES;
} else if (result === UserNotificationSettings.ONLY_MENTIONS) {
ALL_MESSAGES = ThreadMemberFlags.ONLY_MENTIONS;
} else {
ALL_MESSAGES = ThreadMemberFlags.ALL_MESSAGES;
}
return ALL_MESSAGES;
}
}
2026-07-23 10:11:24 +00:00
obj5 = require(1360) /* hasFlag */;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj4 = require(1360) /* hasFlag */;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj6 = require(1360) /* hasFlag */;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let result = require("_isNativeReflectConstruct").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;
const items = [closure_4, closure_3, _isNativeReflectConstruct];
2026-07-20 16:05:17 +00:00
const items1 = [channel];
2026-07-23 10:11:24 +00:00
return _require(566).useStateFromStores(items, () => outer1_7(closure_0), items1);
2026-07-20 16:05:17 +00:00
};