decord/alpha/source/modules/routing/transitionToChannel.tsx

128 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 5102
// Function ID: 5103
2026-07-20 16:05:17 +00:00
// Name: transitionToChannel
2026-10-09 10:00:15 +00:00
// Dependencies: [2064, 1085, 5103, 5104, 1112, 5105, 38, 2]
2026-07-29 08:29:29 +00:00
// Exports: transitionToChannel, transitionToMessage, transitionToStaticChannelRoute, transitionToThread, transitionToThreadMessage, tryTransitionToThreadMessage
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 5102 (transitionToChannel)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import router_utils from "router_utils" /* 1112 */;
2026-10-09 10:00:15 +00:00
import useGuildIdForChannelRoute from "useGuildIdForChannelRoute" /* 5103 */;
import preloadChannelDefault from "preloadChannel" /* 5104 */;
import ChannelStore from "ChannelStore" /* 2064 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const Routes = Constants.Routes;
const result = size.fileFinishedImporting("modules/routing/transitionToChannel.tsx");
2026-07-29 08:29:29 +00:00
export const transitionToChannel = function transitionToChannel(id, openTextInVoiceIfVoiceChannel) {
const channel = ChannelStore.getChannel(id);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-10-03 08:58:59 +00:00
const obj3 = useGuildIdForChannelRoute;
const guildIdForGenericRedirect = obj3.getGuildIdForGenericRedirect(channel);
2026-10-08 09:57:35 +00:00
preloadChannelDefault(channel.guild_id, channel.id);
2026-10-03 08:58:59 +00:00
const transitionTo = router_utils.transitionTo;
2026-07-20 16:05:17 +00:00
const obj = { openChannel: true };
2026-10-03 08:58:59 +00:00
router_utils;
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id);
2026-07-20 16:05:17 +00:00
const merged = Object.assign(openTextInVoiceIfVoiceChannel);
2026-10-03 08:58:59 +00:00
transitionTo(CHANNELResult, obj);
2026-07-29 08:29:29 +00:00
let prop;
2026-10-03 08:58:59 +00:00
const tmp7 = importDefault;
2026-07-29 08:29:29 +00:00
if (openTextInVoiceIfVoiceChannel != null) {
prop = openTextInVoiceIfVoiceChannel.openTextInVoiceIfVoiceChannel;
}
if (prop) {
prop = channel.isGuildVocal();
}
if (prop) {
2026-10-09 10:00:15 +00:00
const tmp7Result = tmp7(5105);
2026-10-03 08:58:59 +00:00
tmp7Result.updateChatOpen(channel.id, true);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const transitionToThread = function transitionToThread(channel, arg1) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
2026-10-03 08:58:59 +00:00
const obj = useGuildIdForChannelRoute;
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
const transitionTo = router_utils.transitionTo;
const obj2 = { openChannel: true };
router_utils;
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id);
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
2026-10-03 08:58:59 +00:00
transitionTo(CHANNELResult, obj2);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const transitionToThreadMessage = function transitionToThreadMessage(channel, id, arg2) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
2026-10-03 08:58:59 +00:00
const obj = useGuildIdForChannelRoute;
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
const transitionTo = router_utils.transitionTo;
const obj2 = { openChannel: true };
router_utils;
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, id);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(arg2);
2026-10-03 08:58:59 +00:00
transitionTo(CHANNELResult, obj2);
2026-07-29 08:29:29 +00:00
};
export const tryTransitionToThreadMessage = function tryTransitionToThreadMessage(parentChannelId, threadId, messageId, arg3) {
const channel = ChannelStore.getChannel(threadId);
2026-10-03 08:58:59 +00:00
const obj = ChannelStore;
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
2026-10-03 08:58:59 +00:00
const obj3 = useGuildIdForChannelRoute;
const guildIdForGenericRedirect = obj3.getGuildIdForGenericRedirect(channel);
const transitionTo = router_utils.transitionTo;
const obj2 = { openChannel: true };
2026-10-03 08:58:59 +00:00
router_utils;
2026-07-29 08:29:29 +00:00
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId);
2026-10-03 08:58:59 +00:00
const merged = Object.assign(arg3);
transitionTo(CHANNELResult, obj2);
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
const channel1 = obj.getChannel(parentChannelId);
2026-07-29 08:29:29 +00:00
if (null != channel1) {
2026-10-03 08:58:59 +00:00
const obj6 = useGuildIdForChannelRoute;
const guildIdForGenericRedirect1 = obj6.getGuildIdForGenericRedirect(channel1);
2026-10-08 09:57:35 +00:00
preloadChannelDefault(channel1.guild_id, channel1.id);
2026-10-03 08:58:59 +00:00
const transitionTo2 = router_utils.transitionTo;
const obj4 = { openChannel: true };
router_utils;
const CHANNELResult1 = Routes.CHANNEL(guildIdForGenericRedirect1, channel1.id);
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(arg3);
2026-10-03 08:58:59 +00:00
transitionTo2(CHANNELResult1, obj4);
2026-07-29 08:29:29 +00:00
let prop;
2026-10-03 08:58:59 +00:00
const tmp21 = importDefault;
2026-07-29 08:29:29 +00:00
if (arg3 != null) {
prop = arg3.openTextInVoiceIfVoiceChannel;
}
if (prop) {
prop = channel1.isGuildVocal();
}
if (prop) {
2026-10-09 10:00:15 +00:00
const tmp21Result = tmp21(5105);
2026-10-03 08:58:59 +00:00
tmp21Result.updateChatOpen(channel1.id, true);
2026-07-29 08:29:29 +00:00
}
}
2026-07-20 16:05:17 +00:00
}
};
export const transitionToMessage = function transitionToMessage(channelId, messageId, arg2) {
const channel = ChannelStore.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-10-03 08:58:59 +00:00
const obj = useGuildIdForChannelRoute;
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
const transitionTo = router_utils.transitionTo;
const obj2 = { openChannel: true };
router_utils;
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId);
2026-10-03 08:58:59 +00:00
const merged = Object.assign(arg2);
transitionTo(CHANNELResult, obj2);
2026-07-20 16:05:17 +00:00
}
};
2026-10-09 10:00:15 +00:00
export const transitionToStaticChannelRoute = function transitionToStaticChannelRoute(arg0, arg1, arg2) {
2026-10-03 08:58:59 +00:00
const transitionTo = router_utils.transitionTo;
const obj = { openChannel: true };
router_utils;
2026-10-09 10:00:15 +00:00
const CHANNELResult = Routes.CHANNEL(arg0, arg1);
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg2);
2026-10-03 08:58:59 +00:00
transitionTo(CHANNELResult, obj);
2026-07-20 16:05:17 +00:00
};