decord/alpha/source/modules/channel/ChannelStatusStore.tsx

74 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 7245
// Function ID: 7246
// Name: ChannelStatusStore
2026-10-09 10:00:15 +00:00
// Dependencies: [5754, 504, 1106, 584, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 7245 (ChannelStatusStore)
2026-10-03 08:58:59 +00:00
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 584 */;
import ChannelTypes from "ChannelTypes" /* 1106 */;
2026-10-09 10:00:15 +00:00
import GatewayConnectionStore from "GatewayConnectionStore" /* 5754 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function handleConnectionReset() {
set.clear();
}
function handleGuildReset(guild) {
set.delete(guild.guild.id);
}
const set = new Set();
2026-10-03 08:58:59 +00:00
const React3 = {};
const Store = get_initializedDefault.Store;
2026-07-29 08:29:29 +00:00
class ChannelStatusStore extends Store {
2026-10-03 08:58:59 +00:00
initialize() {
this.waitFor(GatewayConnectionStore);
}
getChannelStatus(guild_id) {
if (null != guild_id) {
if (null != guild_id.guild_id) {
if (guild_id.type === ChannelTypes.ChannelTypes.GUILD_VOICE) {
let tmp5;
if (closure_4[guild_id.guild_id] != null) {
tmp5 = tmp4[guild_id.id];
}
return tmp5;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
hasRequestedStatuses(guild_id) {
return set.has(guild_id);
}
}
const prototype = ChannelStatusStore.prototype;
2026-07-29 08:29:29 +00:00
ChannelStatusStore.displayName = "ChannelStatusStore";
2026-10-03 08:58:59 +00:00
const obj = {
2026-07-20 16:05:17 +00:00
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_STATUS_UPDATE: function handleVoiceChannelStatusUpdate(guildId) {
2026-10-03 08:58:59 +00:00
if (null == closure_4[guildId.guildId]) {
closure_4[guildId.guildId] = {};
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
closure_4[guildId.guildId][guildId.id] = guildId.status;
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
CHANNEL_INFO: function handleChannelInfo(arg0) {
2026-10-03 08:58:59 +00:00
let channels;
let guildId;
2026-07-29 08:29:29 +00:00
({ guildId, channels } = arg0);
2026-10-03 08:58:59 +00:00
closure_4[guildId] = {};
2026-07-29 08:29:29 +00:00
for (const item10009 of channels) {
2026-10-03 08:58:59 +00:00
closure_4[guildId][item10009.id] = item10009.status;
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(guildId) {
set.add(guildId.guildId);
}
2026-10-03 08:58:59 +00:00
};
const channelStatusStore = new ChannelStatusStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("modules/channel/ChannelStatusStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelStatusStore;