decord/source/modules/routing/transitionToChannel.tsx

79 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 4138
2026-07-24 07:16:23 +00:00
// Function ID: 34393
2026-07-20 16:05:17 +00:00
// Name: transitionToChannel
2026-07-23 10:11:24 +00:00
// Dependencies: [1348, 653, 4139, 4140, 1198, 4323, 44, 2]
2026-07-20 16:05:17 +00:00
// Exports: transitionToMessage, transitionToStaticChannelRoute, transitionToThread, tryTransitionToThreadMessage
2026-07-23 10:11:24 +00:00
// Module 4138 (transitionToChannel)
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { Routes } from "ME";
const require = arg1;
2026-07-20 16:05:17 +00:00
function transitionToChannel(id, openTextInVoiceIfVoiceChannel) {
const channel = store.getChannel(id);
if (null != channel) {
2026-07-23 10:11:24 +00:00
const guildIdForGenericRedirect = require(4139) /* useGuildIdForChannelRoute */.getGuildIdForGenericRedirect(channel);
const obj3 = require(4139) /* useGuildIdForChannelRoute */;
importDefault(4140).preload(channel.guild_id, channel.id);
const obj4 = importDefault(4140);
2026-07-20 16:05:17 +00:00
const obj = { openChannel: true };
2026-07-23 10:11:24 +00:00
const obj5 = require(1198) /* shouldNavigate */;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(openTextInVoiceIfVoiceChannel);
obj5.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id), obj);
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id);
if (tmp) {
2026-07-23 10:11:24 +00:00
importDefault(4323).updateChatOpen(channel.id, true);
const obj2 = importDefault(4323);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
tmp = null != openTextInVoiceIfVoiceChannel && openTextInVoiceIfVoiceChannel.openTextInVoiceIfVoiceChannel && channel.isGuildVocal();
2026-07-20 16:05:17 +00:00
}
}
function transitionToThreadMessage(channel, id, openTextInVoiceIfVoiceChannel) {
2026-07-23 10:11:24 +00:00
importDefault(44)(null != channel.parent_id, "Thread must have a parent ID.");
let obj = require(4139) /* useGuildIdForChannelRoute */;
2026-07-20 16:05:17 +00:00
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
obj = { openChannel: true };
2026-07-23 10:11:24 +00:00
const obj2 = require(1198) /* shouldNavigate */;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(openTextInVoiceIfVoiceChannel);
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id, id), obj);
}
2026-07-23 10:11:24 +00:00
const result = require("useGuildIdForChannelRoute").fileFinishedImporting("modules/routing/transitionToChannel.tsx");
2026-07-20 16:05:17 +00:00
export { transitionToChannel };
export const transitionToThread = function transitionToThread(channel, arg1) {
2026-07-23 10:11:24 +00:00
importDefault(44)(null != channel.parent_id, "Thread must have a parent ID.");
let obj = require(4139) /* useGuildIdForChannelRoute */;
2026-07-20 16:05:17 +00:00
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
obj = { openChannel: true };
2026-07-23 10:11:24 +00:00
const obj2 = require(1198) /* shouldNavigate */;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id), obj);
};
export { transitionToThreadMessage };
export const tryTransitionToThreadMessage = function tryTransitionToThreadMessage(parentChannelId, threadId, messageId, openTextInVoiceIfVoiceChannel) {
const channel = store.getChannel(threadId);
if (null != channel) {
transitionToThreadMessage(channel, messageId, openTextInVoiceIfVoiceChannel);
} else {
transitionToChannel(parentChannelId, openTextInVoiceIfVoiceChannel);
}
};
2026-07-21 06:55:02 +00:00
export const transitionToMessage = function transitionToMessage(channelId, id, arg2) {
2026-07-20 16:05:17 +00:00
const channel = store.getChannel(channelId);
if (null != channel) {
2026-07-23 10:11:24 +00:00
let obj = require(4139) /* useGuildIdForChannelRoute */;
2026-07-20 16:05:17 +00:00
const guildIdForGenericRedirect = obj.getGuildIdForGenericRedirect(channel);
obj = { openChannel: true };
2026-07-23 10:11:24 +00:00
const obj2 = require(1198) /* shouldNavigate */;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg2);
2026-07-21 06:55:02 +00:00
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id, id), obj);
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, id);
2026-07-20 16:05:17 +00:00
}
};
export const transitionToStaticChannelRoute = function transitionToStaticChannelRoute(guildId, GUILD_HOME) {
2026-07-23 10:11:24 +00:00
let obj = require(1198) /* shouldNavigate */;
2026-07-20 16:05:17 +00:00
obj = { openChannel: true };
const merged = Object.assign(arg2);
obj.transitionTo(Routes.CHANNEL(guildId, GUILD_HOME), obj);
};