decord/source/modules/channel/SelectedChannelManager.tsx

69 lines
3 KiB
TypeScript
Raw Normal View History

// Module ID: 17516
// Function ID: 17517
// Name: SelectedChannelManager
// Dependencies: [1908, 2011, 4395, 1074, 7132, 7356, 5425, 1100, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 17516 (SelectedChannelManager)
import DispatcherDefault from "Dispatcher" /* 573 */;
import router_utils from "router_utils" /* 1100 */;
import SelectedChannelActionCreatorsDefault from "SelectedChannelActionCreators" /* 5425 */;
import transitionToGuild from "transitionToGuild" /* 7356 */;
import MediaEngineStore from "MediaEngineStore" /* 1908 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
import SelectedGuildStore from "SelectedGuildStore" /* 4395 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7132 */;
2026-07-23 10:11:24 +00:00
require = fn;
const findFirstVoiceChannelId = fn(2011).findFirstVoiceChannelId;
const Constants = fn(1074);
({ ChannelTypes: closure_7, Routes: closure_8, ME: closure_9, NULL_STRING_GUILD_ID: c10 } = Constants);
2026-07-29 08:29:29 +00:00
class SelectedChannelManager extends tmp3 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = { GUILD_CREATE: applyArgumentsResult.handleGuildCreate, CHANNEL_CREATE: applyArgumentsResult.handleChannelCreate, LOGOUT: applyArgumentsResult.handleLogout };
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = SelectedChannelManager.prototype;
prototype["handleGuildCreate"] = function handleGuildCreate(guild) {
guild = guild.guild;
const channelId = SelectedChannelStore.getChannelId(React7);
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
2026-07-29 08:29:29 +00:00
if (guild.id === channelId) {
2026-08-24 06:08:38 +00:00
transitionToGuild.transitionToGuild(guild.id);
2026-07-29 08:29:29 +00:00
}
let tmp6 = guild.id === voiceChannelId;
if (tmp6) {
tmp6 = false !== guild.unavailable;
}
if (tmp6) {
tmp6 = null == voiceChannelId;
}
if (tmp6) {
const voiceChannel = SelectedChannelActionCreatorsDefault.selectVoiceChannel(findFirstVoiceChannelId(guild.id));
2026-07-29 08:29:29 +00:00
}
};
prototype["handleChannelCreate"] = function handleChannelCreate(channel) {
channel = channel.channel;
if (channel.type === constants.GROUP_DM) {
const originChannelId = channel.originChannelId;
const channelId = SelectedChannelStore.getChannelId(closure_1_10);
2026-07-29 08:29:29 +00:00
if (tmp) {
router_utils.transitionTo(React6.CHANNEL(React7, channel.id));
2026-07-29 08:29:29 +00:00
}
tmp = null == SelectedGuildStore.getGuildId() && null != originChannelId && originChannelId === channelId;
2026-07-29 08:29:29 +00:00
if (tmp7) {
const voiceChannel = SelectedChannelActionCreatorsDefault.selectVoiceChannel(channel.id, MediaEngineStore.isVideoEnabled());
2026-07-29 08:29:29 +00:00
}
tmp7 = null != originChannelId && originChannelId === SelectedChannelStore.getVoiceChannelId();
2026-07-29 08:29:29 +00:00
}
};
prototype["handleLogout"] = function handleLogout() {
DispatcherDefault.dispatch({ type: "VOICE_CHANNEL_SELECT", channelId: null, guildId: null, video: false, currentVoiceChannelId: null, joinVoiceId: null });
2026-07-29 08:29:29 +00:00
};
const selectedChannelManager = new SelectedChannelManager();
const size = fn(2);
const result = size.fileFinishedImporting("modules/channel/SelectedChannelManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default selectedChannelManager;