2026-10-12 16:32:48 +00:00
|
|
|
// Module ID: 6061
|
|
|
|
|
// Function ID: 6062
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: ChannelSectionStore
|
2026-10-12 16:32:48 +00:00
|
|
|
// Dependencies: [5016, 6062, 2069, 2065, 2087, 4750, 2116, 4939, 1390, 1085, 2072, 1096, 6063, 6064, 1121, 11, 5294, 504, 1453, 584, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: isViewChannelSidebar
|
|
|
|
|
|
2026-10-12 16:32:48 +00:00
|
|
|
// Module 6061 (ChannelSectionStore)
|
2026-09-18 19:45:33 +00:00
|
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import get_initializedDefault from "get initialized" /* 504 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 584 */;
|
|
|
|
|
import Constants2 from "Constants" /* 1096 */;
|
|
|
|
|
import ComponentDispatchUtils from "ComponentDispatchUtils" /* 1121 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import ApexExperiment from "ApexExperiment" /* 1453 */;
|
|
|
|
|
import ChannelRecord from "ChannelRecord" /* 2069 */;
|
|
|
|
|
import shared_PlatformUtils from "shared/PlatformUtils" /* 5294 */;
|
|
|
|
|
import SidebarActionTypes from "SidebarActionTypes" /* 6063 */;
|
|
|
|
|
import FriendsSidebarExperimentDefault from "FriendsSidebarExperiment" /* 6064 */;
|
|
|
|
|
import ExperimentStore from "ExperimentStore" /* 5016 */;
|
|
|
|
|
import SearchMessageStore from "SearchMessageStore" /* 6062 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2065 */;
|
|
|
|
|
import GuildStore from "GuildStore" /* 2087 */;
|
|
|
|
|
import PermissionStore from "PermissionStore" /* 4750 */;
|
|
|
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2116 */;
|
|
|
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4939 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1390 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import Constants from "Constants" /* 1085 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import ChannelConstants from "ChannelConstants" /* 2072 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_12;
|
|
|
|
|
let closure_14;
|
|
|
|
|
let closure_15;
|
|
|
|
|
let map1;
|
2026-09-18 19:45:33 +00:00
|
|
|
function toggleSection(c17, arg1) {
|
2026-10-12 16:32:48 +00:00
|
|
|
let tmp14;
|
2026-09-18 19:45:33 +00:00
|
|
|
let flag = arg1;
|
|
|
|
|
if (arg1 === undefined) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
let flag2 = false;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (c26) {
|
|
|
|
|
c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
flag2 = true;
|
|
|
|
|
}
|
|
|
|
|
const channelId = SelectedChannelStore.getChannelId();
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp2 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = channelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(channelId)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp6 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp6 = authStore3(channelId, guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = tmp6;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp8 = null != tmp2 && tmp2 in sidebars;
|
|
|
|
|
if (tmp8) {
|
|
|
|
|
delete sidebars[tmp2];
|
2026-09-18 19:45:33 +00:00
|
|
|
flag2 = true;
|
|
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
let sidebarEnabled = flag;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (sidebarEnabled) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = FriendsSidebarExperimentDefault;
|
2026-10-12 16:32:48 +00:00
|
|
|
sidebarEnabled = obj.getConfig({ location: "ChannelSectionStore" }).appBarToggleEnabled ? closure_22 : closure_21;
|
|
|
|
|
}
|
|
|
|
|
if (sidebarEnabled) {
|
|
|
|
|
const obj2 = FriendsSidebarExperimentDefault;
|
|
|
|
|
sidebarEnabled = obj2.getConfig({ location: "ChannelSectionStore" }).sidebarEnabled;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (sidebarEnabled) {
|
|
|
|
|
flag2 = true;
|
|
|
|
|
}
|
|
|
|
|
if (!flag2) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp14 = !c17;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp14 = c17;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp15 = tmp14 && flag;
|
|
|
|
|
if (tmp15) {
|
|
|
|
|
const obj3 = FriendsSidebarExperimentDefault;
|
|
|
|
|
if (obj3.getConfig({ location: "ChannelSectionStore" }).appBarToggleEnabled) {
|
|
|
|
|
closure_22 = false;
|
|
|
|
|
} else {
|
|
|
|
|
closure_21 = false;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
return tmp14;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
function handlePermissionsChange() {
|
|
|
|
|
let flag = false;
|
|
|
|
|
let flag2 = false;
|
|
|
|
|
const keys = Object.keys();
|
|
|
|
|
if (keys !== undefined) {
|
|
|
|
|
flag2 = flag;
|
|
|
|
|
while (keys[tmp] !== undefined) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp12 = sidebars[tmp4];
|
|
|
|
|
let tmp10 = tmp4;
|
|
|
|
|
if (tmp12.type !== SidebarActionTypes.SidebarType.VIEW_CHANNEL) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channel = ChannelStore.getChannel(tmp12.channelId);
|
2026-09-18 19:45:33 +00:00
|
|
|
let canResult = null != channel;
|
|
|
|
|
if (canResult) {
|
|
|
|
|
canResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
flag = tmp3;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (canResult) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete sidebars[tmp10];
|
2026-09-18 19:45:33 +00:00
|
|
|
flag = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag2;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const isChannelChatInSidebar = ChannelRecord.isChannelChatInSidebar;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ ChannelSections: closure_12, ComponentActions: map1 } = Constants);
|
|
|
|
|
({ isStaticChannelRoute: closure_14, buildGuildStaticChannelId: closure_15 } = ChannelConstants);
|
2026-10-01 14:13:23 +00:00
|
|
|
const Permissions = Constants2.Permissions;
|
2026-09-18 19:45:33 +00:00
|
|
|
let c17 = false;
|
2026-10-12 16:32:48 +00:00
|
|
|
const authStore5 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let c19 = false;
|
|
|
|
|
const isProfileOpen = true;
|
|
|
|
|
const isFriendsOpen = true;
|
2026-10-12 16:32:48 +00:00
|
|
|
const authStore6 = false;
|
2026-09-21 13:40:21 +00:00
|
|
|
let available = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let sidebars = {};
|
|
|
|
|
let guildSidebars = {};
|
2026-10-12 16:32:48 +00:00
|
|
|
let c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let searchContextId = null;
|
2026-10-01 14:13:23 +00:00
|
|
|
const PersistedStore = get_initializedDefault.PersistedStore;
|
2026-09-18 19:45:33 +00:00
|
|
|
class ChannelSectionStore extends PersistedStore {
|
2026-10-01 14:13:23 +00:00
|
|
|
initialize(isMembersOpen) {
|
|
|
|
|
if (null != isMembersOpen) {
|
|
|
|
|
let flag = isMembersOpen.isMembersOpen;
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
let c17 = flag;
|
|
|
|
|
let flag2 = isMembersOpen.isSummariesOpen;
|
|
|
|
|
if (flag2 == null) {
|
|
|
|
|
flag2 = false;
|
|
|
|
|
}
|
|
|
|
|
let c18 = flag2;
|
|
|
|
|
let flag3 = isMembersOpen.isProfileOpen;
|
|
|
|
|
if (flag3 == null) {
|
|
|
|
|
flag3 = true;
|
|
|
|
|
}
|
|
|
|
|
let closure_20 = flag3;
|
|
|
|
|
let flag4 = isMembersOpen.isFriendsOpen;
|
|
|
|
|
if (flag4 == null) {
|
|
|
|
|
flag4 = true;
|
|
|
|
|
}
|
|
|
|
|
let closure_21 = flag4;
|
2026-10-12 16:32:48 +00:00
|
|
|
let flag5 = isMembersOpen.isAppBarToggleOpen;
|
|
|
|
|
if (flag5 == null) {
|
|
|
|
|
flag5 = false;
|
|
|
|
|
}
|
|
|
|
|
let closure_22 = flag5;
|
2026-10-01 14:13:23 +00:00
|
|
|
sidebars = isMembersOpen.sidebars;
|
|
|
|
|
if (sidebars == null) {
|
|
|
|
|
sidebars = {};
|
|
|
|
|
}
|
|
|
|
|
guildSidebars = isMembersOpen.guildSidebars;
|
|
|
|
|
if (guildSidebars == null) {
|
|
|
|
|
guildSidebars = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const items = [PermissionStore];
|
|
|
|
|
this.syncWith(items, handlePermissionsChange);
|
|
|
|
|
this.waitFor(ChannelStore, ExperimentStore, ApexExperiment.ApexExperimentStore, GuildStore, PermissionStore, SearchMessageStore, SelectedChannelStore, SelectedGuildStore, UserStore);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getState() {
|
2026-10-12 16:32:48 +00:00
|
|
|
return { isMembersOpen, isSummariesOpen, isProfileOpen, isFriendsOpen, isAppBarToggleOpen, sidebars, guildSidebars };
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
getSection(arg0, arg1) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
|
|
|
|
return constants.SEARCH;
|
|
|
|
|
} else {
|
|
|
|
|
let MEMBERS;
|
|
|
|
|
let tmp4 = null;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
tmp4 = arg0;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(arg0)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp8 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp8 = authStore3(arg0, guildId);
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
tmp4 = tmp8;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp4) {
|
|
|
|
|
if (null != sidebars[tmp4]) {
|
|
|
|
|
MEMBERS = constants.SIDEBAR_CHAT;
|
|
|
|
|
}
|
|
|
|
|
return MEMBERS;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj = FriendsSidebarExperimentDefault;
|
|
|
|
|
const tmp11 = importDefault;
|
|
|
|
|
if (obj.getConfig({ location: "ChannelSectionStore" }).appBarToggleEnabled ? isAppBarToggleOpen : isFriendsOpen) {
|
|
|
|
|
const tmp11Result = tmp11(6064);
|
|
|
|
|
if (tmp11Result.getConfig({ location: "ChannelSectionStore" }).sidebarEnabled) {
|
2026-10-01 14:13:23 +00:00
|
|
|
MEMBERS = constants.FRIENDS;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp13 = arg1;
|
|
|
|
|
if (tmp13) {
|
|
|
|
|
const tmp14 = isProfileOpen;
|
|
|
|
|
if (tmp14) {
|
2026-10-01 14:13:23 +00:00
|
|
|
MEMBERS = constants.PROFILE;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp15 = c18;
|
|
|
|
|
if (tmp15) {
|
2026-10-01 14:13:23 +00:00
|
|
|
MEMBERS = constants.SUMMARIES;
|
|
|
|
|
} else {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp16 = c17;
|
|
|
|
|
if (tmp16) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!arg1) {
|
|
|
|
|
MEMBERS = constants.MEMBERS;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
MEMBERS = c19 ? tmp19.CONVERSATIONS : tmp19.NONE;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getSidebarState(channelId) {
|
|
|
|
|
let tmp = null;
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
tmp = channelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(channelId)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(channelId, guildId);
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp7;
|
|
|
|
|
if (null != tmp) {
|
|
|
|
|
tmp7 = sidebars[tmp];
|
|
|
|
|
}
|
|
|
|
|
return tmp7;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getGuildSidebarState(arg0) {
|
|
|
|
|
let tmp;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
tmp = guildSidebars[arg0];
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
isFriendsSidebarAvailable() {
|
|
|
|
|
return available;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getCurrentSidebarChannelId(channelId) {
|
|
|
|
|
let tmp = null;
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
tmp = channelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(channelId)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(channelId, guildId);
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == tmp) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp7 = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp7) {
|
|
|
|
|
return null;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp10 = null;
|
|
|
|
|
if (null != sidebars[tmp]) {
|
|
|
|
|
if (sidebars[tmp].type === SidebarActionTypes.SidebarType.VIEW_CHANNEL) {
|
|
|
|
|
channelId = tmp9.channelId;
|
|
|
|
|
} else {
|
|
|
|
|
channelId = null;
|
|
|
|
|
}
|
|
|
|
|
tmp10 = channelId;
|
|
|
|
|
}
|
|
|
|
|
return tmp10;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getCurrentSidebarMessageId(channelId) {
|
|
|
|
|
let tmp = null;
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
tmp = channelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(channelId)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(channelId, guildId);
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == tmp) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp14 = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp14) {
|
|
|
|
|
return null;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp9 = null;
|
|
|
|
|
if (null != sidebars[tmp]) {
|
|
|
|
|
let tmp12;
|
|
|
|
|
if (sidebars[tmp].type === SidebarActionTypes.SidebarType.VIEW_CHANNEL) {
|
|
|
|
|
const details = tmp8.details;
|
|
|
|
|
let initialMessageId;
|
|
|
|
|
if (details != null) {
|
|
|
|
|
initialMessageId = details.initialMessageId;
|
|
|
|
|
}
|
|
|
|
|
tmp12 = initialMessageId;
|
|
|
|
|
} else {
|
|
|
|
|
tmp12 = null;
|
|
|
|
|
}
|
|
|
|
|
tmp9 = tmp12;
|
|
|
|
|
}
|
|
|
|
|
return tmp9;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getCurrentSearchContextId() {
|
|
|
|
|
return searchContextId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const prototype = ChannelSectionStore.prototype;
|
2026-09-18 19:45:33 +00:00
|
|
|
ChannelSectionStore.displayName = "ChannelSectionStore";
|
|
|
|
|
ChannelSectionStore.persistKey = "ChannelSectionStore2";
|
|
|
|
|
let items = [
|
|
|
|
|
(sidebars) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let entries1;
|
|
|
|
|
let fromEntries;
|
|
|
|
|
const obj = {
|
|
|
|
|
sidebars: fromEntries(entries1.filter((item) => {
|
|
|
|
|
let tmp;
|
|
|
|
|
[, tmp] = item;
|
|
|
|
|
let type;
|
|
|
|
|
if (tmp != null) {
|
|
|
|
|
type = tmp.type;
|
|
|
|
|
}
|
|
|
|
|
return 1 !== type;
|
|
|
|
|
}))
|
|
|
|
|
};
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(sidebars);
|
|
|
|
|
sidebars = sidebars.sidebars;
|
2026-10-01 14:13:23 +00:00
|
|
|
const _Object = Object;
|
|
|
|
|
fromEntries = Object.fromEntries;
|
|
|
|
|
const _Object2 = Object;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (sidebars == null) {
|
|
|
|
|
sidebars = {};
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
entries1 = entries(sidebars);
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
ChannelSectionStore.migrations = items;
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = {
|
2026-09-18 19:45:33 +00:00
|
|
|
SIDEBAR_SET_SELECTED_SEARCH_CONTEXT: function handleSetSelectedSearchContext(searchContextId) {
|
|
|
|
|
searchContextId = searchContextId.searchContextId;
|
2026-10-01 14:13:23 +00:00
|
|
|
const hasSearchStateResult = null != searchContextId && SearchMessageStore.hasSearchState(searchContextId);
|
2026-10-12 16:32:48 +00:00
|
|
|
let flag = hasSearchStateResult !== c26;
|
2026-09-28 16:18:32 +00:00
|
|
|
if (flag) {
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = hasSearchStateResult;
|
2026-09-28 16:18:32 +00:00
|
|
|
flag = true;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-09-28 16:18:32 +00:00
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
SEARCH_MESSAGES_START: function handleSearchMessagesStart(ids) {
|
|
|
|
|
ids = ids.ids;
|
|
|
|
|
let tmp = null != searchContextId;
|
|
|
|
|
if (tmp) {
|
|
|
|
|
let hasItem = ids.includes(searchContextId);
|
|
|
|
|
if (hasItem) {
|
2026-10-12 16:32:48 +00:00
|
|
|
let flag = !c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (flag) {
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = true;
|
2026-09-28 16:18:32 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
hasItem = flag;
|
|
|
|
|
}
|
|
|
|
|
tmp = hasItem;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
},
|
|
|
|
|
SEARCH_MESSAGES_CLEAR: function handleSearchMessagesClear(id) {
|
|
|
|
|
let tmp = id.id === searchContextId;
|
|
|
|
|
if (tmp) {
|
2026-10-12 16:32:48 +00:00
|
|
|
let flag = c26;
|
2026-09-28 16:18:32 +00:00
|
|
|
if (flag) {
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-28 16:18:32 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
tmp = flag;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
},
|
|
|
|
|
CONNECTION_OPEN: function handleConnectionOpen() {
|
2026-10-12 16:32:48 +00:00
|
|
|
let flag = c26;
|
2026-09-28 16:18:32 +00:00
|
|
|
if (flag) {
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-28 16:18:32 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
CHANNEL_TOGGLE_MEMBERS_SECTION: function handleChannelToggleMembersSection() {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
2026-10-01 14:13:23 +00:00
|
|
|
ComponentDispatch.dispatch(map1.SEARCH_RESULTS_CLOSE);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (c18) {
|
2026-10-01 14:13:23 +00:00
|
|
|
c18 = toggleSection(tmp6);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (c19) {
|
2026-10-01 14:13:23 +00:00
|
|
|
c19 = toggleSection(tmp8);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
c17 = toggleSection(c17, true);
|
|
|
|
|
},
|
|
|
|
|
USER_PROFILE_SIDEBAR_TOGGLE_SECTION: function handleUserProfileSidebarToggleSection() {
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp = closure_20;
|
|
|
|
|
if (!tmp) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
2026-10-01 14:13:23 +00:00
|
|
|
ComponentDispatch.dispatch(map1.SEARCH_RESULTS_CLOSE);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
closure_20 = toggleSection(closure_20, true);
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TOGGLE_SUMMARIES_SECTION: function handleChannelToggleSummariesSection() {
|
|
|
|
|
if (c17) {
|
|
|
|
|
c17 = toggleSection(tmp);
|
|
|
|
|
}
|
|
|
|
|
if (c19) {
|
|
|
|
|
c19 = toggleSection(tmp3);
|
|
|
|
|
}
|
|
|
|
|
c18 = toggleSection(c18, true);
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_TOGGLE_CONVERSATIONS_SECTION: function handleChannelToggleConversationsSection() {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
2026-10-01 14:13:23 +00:00
|
|
|
ComponentDispatch.dispatch(map1.SEARCH_RESULTS_CLOSE);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let c17 = false;
|
|
|
|
|
let c18 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
c19 = toggleSection(c19, true);
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_OPEN_CONVERSATIONS_SECTION: function handleChannelOpenConversationsSection() {
|
|
|
|
|
let flag = !c19;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (flag) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp = c26;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
2026-10-01 14:13:23 +00:00
|
|
|
ComponentDispatch.dispatch(map1.SEARCH_RESULTS_CLOSE);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let c17 = false;
|
|
|
|
|
let c18 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
c19 = true;
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj = FriendsSidebarExperimentDefault;
|
|
|
|
|
if (obj.getConfig({ location: "ChannelSectionStore" }).appBarToggleEnabled) {
|
|
|
|
|
let closure_22 = false;
|
|
|
|
|
flag = true;
|
|
|
|
|
} else {
|
|
|
|
|
let closure_21 = false;
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
SIDEBAR_VIEW_CHANNEL: function handleSidebarViewChannel(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let baseChannelId;
|
|
|
|
|
let channelId;
|
|
|
|
|
let details;
|
|
|
|
|
let sidebarType;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ sidebarType, baseChannelId } = arg0);
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = null;
|
|
|
|
|
({ channelId, details } = arg0);
|
|
|
|
|
if (null != baseChannelId) {
|
|
|
|
|
tmp = baseChannelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(baseChannelId)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(baseChannelId, guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null == tmp) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
const obj = { type: sidebarType, channelId, details };
|
|
|
|
|
let tmp9 = obj;
|
|
|
|
|
if (sidebarType === SidebarActionTypes.SidebarType.VIEW_MOD_REPORT) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = { baseChannelId };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(obj);
|
|
|
|
|
tmp9 = obj2;
|
|
|
|
|
}
|
|
|
|
|
sidebars[tmp] = tmp9;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SIDEBAR_VIEW_GUILD: function handleSidebarViewGuild(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let baseChannelId;
|
|
|
|
|
let details;
|
|
|
|
|
let guildId;
|
|
|
|
|
let sidebarType;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guildId, baseChannelId } = arg0);
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = null;
|
|
|
|
|
({ sidebarType, details } = arg0);
|
|
|
|
|
if (null != baseChannelId) {
|
|
|
|
|
tmp = baseChannelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(baseChannelId)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const guildId1 = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId1) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(baseChannelId, guildId1);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let flag = null != tmp;
|
|
|
|
|
if (flag) {
|
|
|
|
|
const obj = { type: sidebarType, baseChannelId: tmp, guildId, details };
|
|
|
|
|
guildSidebars[guildId] = obj;
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
SIDEBAR_CREATE_THREAD: function handleCreateThread(parentChannelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let _location;
|
|
|
|
|
let parentMessageId;
|
2026-09-18 19:45:33 +00:00
|
|
|
parentChannelId = parentChannelId.parentChannelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp = null;
|
|
|
|
|
({ parentMessageId, location: _location } = parentChannelId);
|
|
|
|
|
if (null != parentChannelId) {
|
|
|
|
|
tmp = parentChannelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(parentChannelId)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
|
|
|
|
let tmp5 = null;
|
|
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(parentChannelId, guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp = tmp5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != tmp) {
|
2026-10-01 14:13:23 +00:00
|
|
|
sidebars[tmp] = { type: SidebarActionTypes.SidebarType.CREATE_THREAD, parentChannelId, parentMessageId, location: _location };
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = { type: SidebarActionTypes.SidebarType.CREATE_THREAD, parentChannelId, parentMessageId, location: _location };
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SIDEBAR_CLOSE: function handleCloseSidebar(baseChannelId) {
|
|
|
|
|
baseChannelId = baseChannelId.baseChannelId;
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != baseChannelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp = baseChannelId;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (syncedClientThemes(baseChannelId)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const guildId = SelectedGuildStore.getGuildId();
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp5 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != guildId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp5 = authStore3(baseChannelId, guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp = tmp5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp) {
|
|
|
|
|
delete sidebars[tmp];
|
|
|
|
|
const hasSearchStateResult = null != searchContextId && SearchMessageStore.hasSearchState(searchContextId);
|
2026-10-12 16:32:48 +00:00
|
|
|
if (hasSearchStateResult !== c26) {
|
|
|
|
|
c26 = hasSearchStateResult;
|
2026-09-28 16:18:32 +00:00
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
2026-10-01 14:13:23 +00:00
|
|
|
SIDEBAR_CLOSE_GUILD: function handleGuildCloseSidebar(guildId) {
|
|
|
|
|
guildId = guildId.guildId;
|
|
|
|
|
let flag = null != guildSidebars[guildId];
|
2026-09-18 19:45:33 +00:00
|
|
|
if (flag) {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete guildSidebars[guildId];
|
|
|
|
|
const hasSearchStateResult = null != searchContextId && SearchMessageStore.hasSearchState(searchContextId);
|
2026-09-18 19:45:33 +00:00
|
|
|
flag = true;
|
2026-10-12 16:32:48 +00:00
|
|
|
if (hasSearchStateResult !== c26) {
|
|
|
|
|
c26 = hasSearchStateResult;
|
2026-09-18 19:45:33 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
FRIENDS_SIDEBAR_SET_COLLAPSED: function handleSetFriendsSidebarCollapsed(collapsed) {
|
|
|
|
|
collapsed = collapsed.collapsed;
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj = FriendsSidebarExperimentDefault;
|
|
|
|
|
if (obj.getConfig({ location: "ChannelSectionStore" }).appBarToggleEnabled) {
|
|
|
|
|
let closure_22 = tmp;
|
|
|
|
|
} else {
|
|
|
|
|
let closure_21 = tmp;
|
|
|
|
|
}
|
|
|
|
|
if (!collapsed) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const channelId = SelectedChannelStore.getChannelId();
|
|
|
|
|
if (null != channelId) {
|
2026-10-12 16:32:48 +00:00
|
|
|
delete sidebars[tmp4];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp6 = c26;
|
|
|
|
|
if (tmp6) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
2026-10-01 14:13:23 +00:00
|
|
|
ComponentDispatch.dispatch(map1.SEARCH_RESULTS_CLOSE);
|
2026-10-12 16:32:48 +00:00
|
|
|
c26 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-09-21 13:40:21 +00:00
|
|
|
FRIENDS_SIDEBAR_SET_AVAILABLE: function handleSetFriendsSidebarAvailable(available) {
|
|
|
|
|
available = available.available;
|
|
|
|
|
let flag = available !== available;
|
|
|
|
|
if (flag) {
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
2026-09-18 19:45:33 +00:00
|
|
|
CHANNEL_DELETE: function handleChannelDelete(channel) {
|
|
|
|
|
channel = channel.channel;
|
|
|
|
|
let flag = false;
|
|
|
|
|
if (channel.id in sidebars) {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete sidebars[channel.id];
|
2026-09-18 19:45:33 +00:00
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
let flag2 = flag;
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp2 = flag;
|
2026-09-18 19:45:33 +00:00
|
|
|
const keys = Object.keys();
|
|
|
|
|
if (keys !== undefined) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = flag2;
|
2026-09-18 19:45:33 +00:00
|
|
|
while (keys[tmp] !== undefined) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp11 = sidebars[tmp5];
|
|
|
|
|
let hasItem = null != tmp11;
|
|
|
|
|
let tmp9 = tmp5;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (hasItem) {
|
|
|
|
|
let items = [SidebarActionTypes.SidebarType.VIEW_CHANNEL, SidebarActionTypes.SidebarType.VIEW_MESSAGE_REQUEST, SidebarActionTypes.SidebarType.VIEW_MOD_REPORT];
|
2026-10-01 14:13:23 +00:00
|
|
|
hasItem = items.includes(tmp11.type);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (hasItem) {
|
2026-10-01 14:13:23 +00:00
|
|
|
hasItem = tmp11.channelId === channel.id;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (!hasItem) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete sidebars[tmp9];
|
2026-09-18 19:45:33 +00:00
|
|
|
flag2 = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp2;
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
CHANNEL_SELECT: function handleChannelSelect(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let messageId;
|
|
|
|
|
let obj2;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channelId, messageId } = arg0);
|
|
|
|
|
let flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp3 = shared_PlatformUtils.isMobile && c17;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (tmp3) {
|
|
|
|
|
c17 = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
let c18 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
c19 = false;
|
|
|
|
|
flag = true;
|
|
|
|
|
}
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
if (null != messageId) {
|
|
|
|
|
let type;
|
|
|
|
|
if (sidebars[channelId] != null) {
|
|
|
|
|
type = tmp10.type;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (type === SidebarActionTypes.SidebarType.VIEW_CHANNEL) {
|
|
|
|
|
if (sidebars[channelId].channelId === channelId) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
|
|
|
let flag2 = flag;
|
|
|
|
|
if (null != channel) {
|
|
|
|
|
flag2 = flag;
|
|
|
|
|
if (isChannelChatInSidebar(channel.type)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { type: SidebarActionTypes.SidebarType.VIEW_CHANNEL, channelId, details: obj2 };
|
2026-09-18 19:45:33 +00:00
|
|
|
sidebars[channelId] = obj;
|
|
|
|
|
flag2 = true;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj2 = { type: SidebarActionTypes.ViewChannelDetailType.CHAT, initialMessageId: messageId };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
THREAD_CREATE: function handleThreadCreate(channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj3;
|
2026-09-18 19:45:33 +00:00
|
|
|
channel = channel.channel;
|
2026-10-01 14:13:23 +00:00
|
|
|
const ownerId = channel.ownerId;
|
2026-09-18 19:45:33 +00:00
|
|
|
const currentUser = UserStore.getCurrentUser();
|
|
|
|
|
let id;
|
|
|
|
|
if (currentUser != null) {
|
|
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (ownerId === id) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp5 = null != tmp12 && tmp12.type === SidebarActionTypes.SidebarType.CREATE_THREAD;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (tmp5) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const parentMessageId = tmp12.parentMessageId;
|
|
|
|
|
const obj = SnowflakeUtilsDefault;
|
|
|
|
|
tmp5 = parentMessageId === obj.castChannelIdAsMessageId(channel.id);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (tmp5) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const parent_id = channel.parent_id;
|
|
|
|
|
const obj2 = { type: SidebarActionTypes.SidebarType.VIEW_CHANNEL, channelId: channel.id, details: obj3 };
|
|
|
|
|
sidebars[parent_id] = obj2;
|
|
|
|
|
obj3 = { type: SidebarActionTypes.ViewChannelDetailType.CHAT };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
THREAD_DELETE: function handleThreadDelete(channel) {
|
|
|
|
|
channel = channel.channel;
|
|
|
|
|
if (null != sidebars[channel.parent_id]) {
|
|
|
|
|
const items = [SidebarActionTypes.SidebarType.VIEW_CHANNEL, SidebarActionTypes.SidebarType.VIEW_MESSAGE_REQUEST, SidebarActionTypes.SidebarType.VIEW_MOD_REPORT];
|
2026-10-01 14:13:23 +00:00
|
|
|
if (items.includes(sidebars[channel.parent_id].type)) {
|
|
|
|
|
if (sidebars[channel.parent_id].channelId === channel.id) {
|
|
|
|
|
delete sidebars[channel.parent_id];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
};
|
|
|
|
|
const channelSectionStore = new ChannelSectionStore(DispatcherDefault, obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("stores/ChannelSectionStore.tsx");
|
|
|
|
|
|
|
|
|
|
export default channelSectionStore;
|
|
|
|
|
export const MESSAGE_REQUESTS_BASE_CHANNEL_ID = "message_requests";
|
|
|
|
|
export const isViewChannelSidebar = function isViewChannelSidebar(type) {
|
|
|
|
|
const items = [SidebarActionTypes.SidebarType.VIEW_CHANNEL, SidebarActionTypes.SidebarType.VIEW_MESSAGE_REQUEST, SidebarActionTypes.SidebarType.VIEW_MOD_REPORT];
|
|
|
|
|
return items.includes(type.type);
|
|
|
|
|
};
|