decord/source/modules/channel/ChannelStatusStore.tsx

73 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5278
// Function ID: 5279
2026-07-29 08:29:29 +00:00
// Name: handleConnectionReset
2026-08-24 06:08:38 +00:00
// Dependencies: [4499, 589, 692, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5278 (handleConnectionReset)
import initializeDefault from "initialize" /* 589 */;
import set2 from "set" /* 692 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_2 from "_handleConnectionOpen" /* 4499 */;
import set from "set" /* 2 */;
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 handleConnectionReset() {
set.clear();
}
function handleGuildReset(guild) {
set.delete(guild.guild.id);
}
2026-07-23 10:11:24 +00:00
let set = new Set();
2026-07-29 08:29:29 +00:00
let closure_4 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class ChannelStatusStore extends Store {
}
const prototype = ChannelStatusStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_2);
2026-07-29 08:29:29 +00:00
};
prototype["getChannelStatus"] = function getChannelStatus(guild_id) {
if (null != guild_id) {
if (null != guild_id.guild_id) {
2026-08-24 06:08:38 +00:00
if (guild_id.type === set2.ChannelTypes.GUILD_VOICE) {
2026-07-29 08:29:29 +00:00
let tmp5;
if (dependencyMap[guild_id.guild_id] != null) {
tmp5 = tmp4[guild_id.id];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
};
prototype["hasRequestedStatuses"] = function hasRequestedStatuses(guild_id) {
return set.has(guild_id);
};
ChannelStatusStore.displayName = "ChannelStatusStore";
2026-08-24 06:08:38 +00:00
const channelStatusStore = new ChannelStatusStore(dispatcherDefault, {
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-07-23 10:11:24 +00:00
if (null == dependencyMap[guildId.guildId]) {
2026-07-29 08:29:29 +00:00
tmp[guildId.guildId] = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
dependencyMap[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) {
({ guildId, channels } = arg0);
2026-07-23 10:11:24 +00:00
dependencyMap[guildId] = {};
2026-07-29 08:29:29 +00:00
for (const item10009 of channels) {
let tmp = dependencyMap;
dependencyMap[guildId][item10009.id] = item10009.status;
continue;
2026-07-20 16:05:17 +00:00
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(guildId) {
set.add(guildId.guildId);
}
});
2026-07-29 08:29:29 +00:00
const result = set.fileFinishedImporting("modules/channel/ChannelStatusStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelStatusStore;