decord/source/stores/ChannelSectionStore.tsx

772 lines
20 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 6005
// Function ID: 6006
2026-07-29 08:29:29 +00:00
// Name: handlePermissionsChange
2026-08-25 06:04:03 +00:00
// Dependencies: [4293, 6006, 1391, 1910, 4025, 1981, 4202, 1922, 676, 1398, 505, 6007, 1231, 11, 4642, 589, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: isViewChannelSidebar
2026-08-25 06:04:03 +00:00
// Module 6005 (handlePermissionsChange)
2026-08-24 06:08:38 +00:00
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import ComponentDispatcher from "ComponentDispatcher" /* 1231 */;
2026-08-25 06:04:03 +00:00
import SidebarType from "SidebarType" /* 6007 */;
import closure_3 from "getHash" /* 4293 */;
import closure_4 from "handleReaction" /* 6006 */;
2026-08-24 06:08:38 +00:00
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "getUncachedChannelPermissions" /* 4025 */;
import closure_8 from "handleConnectionOpen" /* 1981 */;
import closure_9 from "handleConnectionOpen" /* 4202 */;
2026-08-24 06:08:38 +00:00
import closure_10 from "mergeGuildAvatar" /* 1922 */;
import ME from "ME" /* 676 */;
import set from "set" /* 1398 */;
import { Permissions } from "sum" /* 505 */;
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 handlePermissionsChange() {
let flag = false;
let flag2 = false;
const keys = Object.keys();
if (keys !== undefined) {
flag2 = flag;
while (keys[tmp] !== undefined) {
2026-07-29 08:29:29 +00:00
let tmp13 = tmp6;
let tmp14 = dependencyMap;
let tmp15 = dependencyMap[tmp6];
let tmp16 = require;
let tmp17 = dependencyMap;
2026-08-24 06:08:38 +00:00
if (tmp15.type === SidebarType.SidebarType.VIEW_THREAD) {
2026-07-29 08:29:29 +00:00
let tmp7 = channel;
channel = channel.getChannel(tmp15.channelId);
2026-07-20 16:05:17 +00:00
let canResult = null != channel;
if (canResult) {
2026-08-24 06:08:38 +00:00
let tmp10 = closure_7;
2026-07-29 08:29:29 +00:00
let tmp11 = Permissions;
2026-08-24 06:08:38 +00:00
canResult = closure_7.can(Permissions.VIEW_CHANNEL, channel);
2026-07-20 16:05:17 +00:00
}
if (canResult) {
continue;
} else {
2026-07-29 08:29:29 +00:00
let tmp12 = dependencyMap;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp3];
2026-07-20 16:05:17 +00:00
flag = true;
2026-07-23 10:11:24 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
continue;
}
}
return flag2;
}
function setIsSearchSidebarOpen() {
2026-07-29 08:29:29 +00:00
let hasSearchStateResult = null != c23;
2026-07-20 16:05:17 +00:00
if (hasSearchStateResult) {
2026-08-24 06:08:38 +00:00
hasSearchStateResult = closure_4.hasSearchState(c23);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (hasSearchStateResult === c22) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
c22 = hasSearchStateResult;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ ChannelSections: unpackModuleId, ComponentActions: closure_12 } = ME);
({ isStaticChannelRoute: map1, buildGuildStaticChannelId: closure_14 } = set);
let c16 = false;
let c17 = false;
let c18 = false;
let c19 = true;
let closure_20 = {};
let closure_21 = {};
2026-07-23 10:11:24 +00:00
let c22 = false;
2026-07-29 08:29:29 +00:00
let c23 = null;
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class ChannelSectionStore extends PersistedStore {
}
const prototype = ChannelSectionStore.prototype;
prototype["initialize"] = function initialize(isMembersOpen) {
if (null != isMembersOpen) {
let flag = isMembersOpen.isMembersOpen;
if (flag == null) {
flag = false;
}
let flag2 = isMembersOpen.isSummariesOpen;
if (flag2 == null) {
flag2 = false;
}
let flag3 = isMembersOpen.isProfileOpen;
if (flag3 == null) {
flag3 = true;
}
let sidebars = isMembersOpen.sidebars;
if (sidebars == null) {
sidebars = {};
}
let guildSidebars = isMembersOpen.guildSidebars;
if (guildSidebars == null) {
guildSidebars = {};
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
const items = [closure_4];
2026-07-29 08:29:29 +00:00
this.syncWith(items, setIsSearchSidebarOpen);
2026-08-24 06:08:38 +00:00
const items1 = [closure_7];
2026-07-29 08:29:29 +00:00
this.syncWith(items1, handlePermissionsChange);
2026-08-24 06:08:38 +00:00
this.waitFor(closure_5, closure_3, closure_6, closure_7, closure_4, closure_8, closure_9, closure_10);
2026-07-29 08:29:29 +00:00
};
prototype["getState"] = function getState() {
return { isMembersOpen: c16, isSummariesOpen: c17, isProfileOpen: c19, sidebars: closure_20, guildSidebars: closure_21 };
};
prototype["getSection"] = function getSection(arg0, arg1) {
if (c22) {
return constants.SEARCH;
} else {
let tmp3 = null;
if (null != arg0) {
tmp3 = arg0;
if (callback(arg0)) {
const guildId = store2.getGuildId();
let tmp7 = null;
if (null != guildId) {
tmp7 = callback2(arg0, guildId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp7;
}
}
if (null != tmp3) {
if (null != dependencyMap[tmp3]) {
let MEMBERS = constants.SIDEBAR_CHAT;
}
return MEMBERS;
}
if (arg1) {
if (c19) {
MEMBERS = constants.PROFILE;
}
}
if (c17) {
MEMBERS = constants.SUMMARIES;
} else if (c16) {
MEMBERS = constants.MEMBERS;
} else {
MEMBERS = c18 ? tmp15.CONVERSATIONS : tmp15.NONE;
}
}
};
prototype["getSidebarState"] = function getSidebarState(channelId) {
let tmp = null;
if (null != channelId) {
tmp = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(channelId, guildId);
}
tmp = tmp5;
}
}
let tmp7;
if (null != tmp) {
tmp7 = dependencyMap[tmp];
}
return tmp7;
};
prototype["getGuildSidebarState"] = function getGuildSidebarState(arg0) {
let tmp;
if (null != arg0) {
tmp = dependencyMap2[arg0];
}
return tmp;
};
prototype["getCurrentSidebarChannelId"] = function getCurrentSidebarChannelId(channelId) {
let tmp = null;
if (null != channelId) {
tmp = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(channelId, guildId);
}
tmp = tmp5;
}
}
if (null == tmp) {
return null;
} else if (c22) {
return null;
} else {
let tmp9 = null;
if (null != dependencyMap[tmp]) {
2026-08-24 06:08:38 +00:00
if (tmp8.type !== SidebarType.SidebarType.VIEW_THREAD) {
2026-08-25 06:04:03 +00:00
if (tmp8.type !== tmp10(6007).SidebarType.VIEW_CHANNEL) {
2026-07-29 08:29:29 +00:00
channelId = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp9 = channelId;
}
channelId = tmp8.channelId;
}
return tmp9;
}
};
prototype["getCurrentSidebarMessageId"] = function getCurrentSidebarMessageId(channelId) {
let tmp = null;
if (null != channelId) {
tmp = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(channelId, guildId);
}
tmp = tmp5;
}
}
if (null == tmp) {
return null;
} else if (c22) {
return null;
} else {
let tmp9 = null;
if (null != dependencyMap[tmp]) {
2026-08-24 06:08:38 +00:00
if (tmp8.type !== SidebarType.SidebarType.VIEW_THREAD) {
2026-08-25 06:04:03 +00:00
if (tmp8.type !== tmp10(6007).SidebarType.VIEW_CHANNEL) {
2026-07-29 08:29:29 +00:00
let tmp12 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp9 = tmp12;
}
const details = tmp8.details;
let initialMessageId;
if (details != null) {
initialMessageId = details.initialMessageId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp12 = initialMessageId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp9;
}
};
prototype["getCurrentSearchContextId"] = function getCurrentSearchContextId() {
return c23;
};
ChannelSectionStore.displayName = "ChannelSectionStore";
ChannelSectionStore.persistKey = "ChannelSectionStore2";
2026-08-24 06:08:38 +00:00
const channelSectionStore = new ChannelSectionStore(dispatcherDefault, {
2026-07-29 08:29:29 +00:00
SIDEBAR_SET_SELECTED_SEARCH_CONTEXT: function handleSetSelectedSearchContext(searchContextId) {
searchContextId = searchContextId.searchContextId;
let hasSearchStateResult = null != searchContextId;
if (hasSearchStateResult) {
2026-08-24 06:08:38 +00:00
hasSearchStateResult = closure_4.hasSearchState(searchContextId);
2026-07-29 08:29:29 +00:00
}
if (hasSearchStateResult !== c22) {
c22 = hasSearchStateResult;
}
return false;
},
CHANNEL_TOGGLE_MEMBERS_SECTION: function handleChannelToggleMembersSection() {
if (c22) {
2026-08-24 06:08:38 +00:00
const ComponentDispatch = ComponentDispatcher.ComponentDispatch;
2026-07-29 08:29:29 +00:00
ComponentDispatch.dispatch(constants2.SEARCH_RESULTS_CLOSE);
}
2026-08-24 06:08:38 +00:00
if (closure_17) {
2026-07-29 08:29:29 +00:00
let flag2 = false;
if (c22) {
c22 = false;
flag2 = true;
}
const channelId = store.getChannelId();
let tmp13 = null;
if (null != channelId) {
tmp13 = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp17 = null;
if (null != guildId) {
tmp17 = callback2(channelId, guildId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp13 = tmp17;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
let tmp19 = null != tmp13;
if (tmp19) {
tmp19 = tmp13 in closure_20;
}
if (tmp19) {
delete tmp[tmp3];
flag2 = true;
}
if (!flag2) {
let tmp22 = !tmp8;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp22 = tmp8;
}
2026-08-24 06:08:38 +00:00
closure_17 = tmp22;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
if (closure_18) {
2026-07-29 08:29:29 +00:00
let flag4 = false;
if (c22) {
c22 = false;
flag4 = true;
}
const channelId1 = store.getChannelId();
let tmp28 = null;
if (null != channelId1) {
tmp28 = channelId1;
if (callback(channelId1)) {
const guildId1 = store2.getGuildId();
let tmp32 = null;
if (null != guildId1) {
tmp32 = callback2(channelId1, guildId1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp28 = tmp32;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp34 = null != tmp28;
if (tmp34) {
tmp34 = tmp28 in closure_20;
}
if (tmp34) {
delete tmp[tmp2];
flag4 = true;
}
if (!flag4) {
let tmp37 = !tmp23;
} else {
tmp37 = tmp23;
}
2026-08-24 06:08:38 +00:00
closure_18 = tmp37;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag5 = false;
if (c22) {
c22 = false;
flag5 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const channelId2 = store.getChannelId();
let tmp40 = null;
if (null != channelId2) {
tmp40 = channelId2;
if (callback(channelId2)) {
const guildId2 = store2.getGuildId();
let tmp44 = null;
if (null != guildId2) {
tmp44 = callback2(channelId2, guildId2);
}
tmp40 = tmp44;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp46 = null != tmp40;
if (tmp46) {
tmp46 = tmp40 in closure_20;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp46) {
delete tmp[tmp3];
flag5 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!flag5) {
let tmp49 = !tmp38;
} else {
tmp49 = tmp38;
}
2026-08-24 06:08:38 +00:00
closure_16 = tmp49;
2026-07-20 16:05:17 +00:00
},
USER_PROFILE_SIDEBAR_TOGGLE_SECTION: function handleUserProfileSidebarToggleSection() {
2026-08-24 06:08:38 +00:00
if (!closure_19) {
const ComponentDispatch = ComponentDispatcher.ComponentDispatch;
2026-07-29 08:29:29 +00:00
ComponentDispatch.dispatch(constants2.SEARCH_RESULTS_CLOSE);
}
let flag = false;
if (c22) {
c22 = false;
flag = true;
}
const channelId = store.getChannelId();
let tmp9 = null;
if (null != channelId) {
tmp9 = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp13 = null;
if (null != guildId) {
tmp13 = callback2(channelId, guildId);
}
tmp9 = tmp13;
}
}
let tmp15 = null != tmp9;
if (tmp15) {
tmp15 = tmp9 in closure_20;
}
if (tmp15) {
delete tmp[tmp2];
flag = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!flag) {
let tmp18 = !tmp7;
} else {
tmp18 = tmp7;
}
2026-08-24 06:08:38 +00:00
closure_19 = tmp18;
2026-07-20 16:05:17 +00:00
},
CHANNEL_TOGGLE_SUMMARIES_SECTION: function handleChannelToggleSummariesSection() {
2026-08-24 06:08:38 +00:00
if (closure_16) {
2026-07-29 08:29:29 +00:00
let flag2 = false;
if (c22) {
c22 = false;
flag2 = true;
}
const channelId = store.getChannelId();
let tmp9 = null;
if (null != channelId) {
tmp9 = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp13 = null;
if (null != guildId) {
tmp13 = callback2(channelId, guildId);
}
tmp9 = tmp13;
}
}
let tmp15 = null != tmp9;
if (tmp15) {
tmp15 = tmp9 in closure_20;
}
if (tmp15) {
delete tmp[tmp3];
flag2 = true;
}
if (!flag2) {
let tmp18 = !tmp4;
} else {
tmp18 = tmp4;
}
2026-08-24 06:08:38 +00:00
closure_16 = tmp18;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
if (closure_18) {
2026-07-29 08:29:29 +00:00
let flag4 = false;
if (c22) {
c22 = false;
flag4 = true;
}
const channelId1 = store.getChannelId();
let tmp24 = null;
if (null != channelId1) {
tmp24 = channelId1;
if (callback(channelId1)) {
const guildId1 = store2.getGuildId();
let tmp28 = null;
if (null != guildId1) {
tmp28 = callback2(channelId1, guildId1);
}
tmp24 = tmp28;
}
}
let tmp30 = null != tmp24;
if (tmp30) {
tmp30 = tmp24 in closure_20;
}
if (tmp30) {
delete tmp[tmp2];
flag4 = true;
}
if (!flag4) {
let tmp33 = !tmp19;
} else {
tmp33 = tmp19;
}
2026-08-24 06:08:38 +00:00
closure_18 = tmp33;
2026-07-29 08:29:29 +00:00
}
let flag5 = false;
if (c22) {
c22 = false;
flag5 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const channelId2 = store.getChannelId();
let tmp36 = null;
if (null != channelId2) {
tmp36 = channelId2;
if (callback(channelId2)) {
const guildId2 = store2.getGuildId();
let tmp40 = null;
if (null != guildId2) {
tmp40 = callback2(channelId2, guildId2);
}
tmp36 = tmp40;
}
}
let tmp42 = null != tmp36;
if (tmp42) {
tmp42 = tmp36 in closure_20;
}
if (tmp42) {
delete tmp[tmp3];
flag5 = true;
}
if (!flag5) {
let tmp45 = !tmp34;
} else {
tmp45 = tmp34;
}
2026-08-24 06:08:38 +00:00
closure_17 = tmp45;
2026-07-20 16:05:17 +00:00
},
CHANNEL_TOGGLE_CONVERSATIONS_SECTION: function handleChannelToggleConversationsSection() {
2026-07-29 08:29:29 +00:00
if (c22) {
2026-08-24 06:08:38 +00:00
const ComponentDispatch = ComponentDispatcher.ComponentDispatch;
2026-07-29 08:29:29 +00:00
ComponentDispatch.dispatch(constants2.SEARCH_RESULTS_CLOSE);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
c16 = false;
c17 = false;
2026-07-29 08:29:29 +00:00
let flag = false;
if (c22) {
c22 = false;
flag = true;
}
const channelId = store.getChannelId();
let tmp9 = null;
if (null != channelId) {
tmp9 = channelId;
if (callback(channelId)) {
const guildId = store2.getGuildId();
let tmp13 = null;
if (null != guildId) {
tmp13 = callback2(channelId, guildId);
}
tmp9 = tmp13;
}
}
let tmp15 = null != tmp9;
if (tmp15) {
tmp15 = tmp9 in closure_20;
}
if (tmp15) {
delete tmp[tmp2];
flag = true;
}
if (!flag) {
let tmp18 = !tmp7;
} else {
tmp18 = tmp7;
}
2026-08-24 06:08:38 +00:00
closure_18 = tmp18;
2026-07-20 16:05:17 +00:00
},
CHANNEL_OPEN_CONVERSATIONS_SECTION: function handleChannelOpenConversationsSection() {
2026-07-29 08:29:29 +00:00
let flag = !c18;
if (!c18) {
if (c22) {
2026-08-24 06:08:38 +00:00
const ComponentDispatch = ComponentDispatcher.ComponentDispatch;
2026-07-29 08:29:29 +00:00
ComponentDispatch.dispatch(constants2.SEARCH_RESULTS_CLOSE);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
c16 = false;
c17 = false;
2026-07-29 08:29:29 +00:00
c18 = true;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
SIDEBAR_VIEW_CHANNEL: function handleSidebarViewChannel(arg0) {
({ sidebarType, baseChannelId } = arg0);
2026-08-24 06:08:38 +00:00
c22 = false;
2026-07-29 08:29:29 +00:00
let tmp = null;
2026-07-20 16:05:17 +00:00
({ channelId, details } = arg0);
2026-07-29 08:29:29 +00:00
if (null != baseChannelId) {
tmp = baseChannelId;
if (callback(baseChannelId)) {
const guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(baseChannelId, guildId);
}
tmp = tmp5;
}
}
2026-07-20 16:05:17 +00:00
if (null == tmp) {
return false;
} else {
2026-07-29 08:29:29 +00:00
let obj = { type: null, channelId: null, details: null };
obj[0] = sidebarType;
obj[1] = channelId;
obj[2] = details;
let tmp9 = obj;
2026-08-24 06:08:38 +00:00
if (sidebarType === SidebarType.SidebarType.VIEW_MOD_REPORT) {
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(obj);
2026-07-29 08:29:29 +00:00
obj.baseChannelId = baseChannelId;
tmp9 = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_20[tmp] = tmp9;
2026-07-20 16:05:17 +00:00
return true;
}
},
2026-07-29 08:29:29 +00:00
SIDEBAR_VIEW_GUILD: function handleSidebarViewGuild(arg0) {
({ guildId, baseChannelId } = arg0);
2026-08-24 06:08:38 +00:00
c22 = false;
2026-07-29 08:29:29 +00:00
let tmp = null;
({ sidebarType, details } = arg0);
if (null != baseChannelId) {
tmp = baseChannelId;
if (callback(baseChannelId)) {
guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(baseChannelId, guildId);
}
tmp = tmp5;
}
}
2026-07-20 16:05:17 +00:00
let flag = null != tmp;
if (flag) {
2026-07-29 08:29:29 +00:00
const obj = { type: null, baseChannelId: null, guildId: null, details: null };
obj[0] = sidebarType;
obj[1] = tmp;
obj[2] = guildId;
obj[3] = details;
closure_21[guildId] = obj;
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
SIDEBAR_CREATE_THREAD: function handleCreateThread(parentChannelId) {
parentChannelId = parentChannelId.parentChannelId;
2026-08-24 06:08:38 +00:00
c22 = false;
2026-07-29 08:29:29 +00:00
let tmp = null;
2026-07-20 16:05:17 +00:00
({ parentMessageId, location: _location } = parentChannelId);
2026-07-29 08:29:29 +00:00
if (null != parentChannelId) {
tmp = parentChannelId;
if (callback(parentChannelId)) {
const guildId = store2.getGuildId();
let tmp5 = null;
if (null != guildId) {
tmp5 = callback2(parentChannelId, guildId);
}
tmp = tmp5;
}
}
2026-07-20 16:05:17 +00:00
if (null != tmp) {
2026-07-29 08:29:29 +00:00
const obj = { type: null, parentChannelId: null, parentMessageId: null, location: null };
2026-08-24 06:08:38 +00:00
obj[0] = SidebarType.SidebarType.CREATE_THREAD;
2026-07-29 08:29:29 +00:00
obj[1] = parentChannelId;
obj[2] = parentMessageId;
obj[3] = _location;
closure_20[tmp] = obj;
2026-07-20 16:05:17 +00:00
}
},
SIDEBAR_CLOSE: function handleCloseSidebar(baseChannelId) {
2026-07-29 08:29:29 +00:00
baseChannelId = baseChannelId.baseChannelId;
let tmp3 = null;
if (null != baseChannelId) {
tmp3 = baseChannelId;
if (callback(baseChannelId)) {
const guildId = store2.getGuildId();
let tmp7 = null;
if (null != guildId) {
tmp7 = callback2(baseChannelId, guildId);
}
tmp3 = tmp7;
}
}
if (null != tmp3) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
},
SIDEBAR_CLOSE_GUILD: function handleGuildCloseSidebar(arg0) {
2026-07-29 08:29:29 +00:00
let flag = null != dependencyMap2[arg0.guildId];
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
CHANNEL_DELETE: function handleChannelDelete(channel) {
channel = channel.channel;
2026-07-23 10:11:24 +00:00
if (channel.id in dependencyMap) {
2026-07-20 16:05:17 +00:00
const id = channel.id;
2026-07-29 08:29:29 +00:00
delete tmp3[tmp2];
2026-07-20 16:05:17 +00:00
return true;
} else {
let flag = false;
let flag2 = false;
const keys = Object.keys();
if (keys !== undefined) {
flag2 = flag;
2026-07-29 08:29:29 +00:00
while (keys[tmp] !== undefined) {
let tmp16 = tmp11;
let tmp17 = dependencyMap;
let tmp18 = dependencyMap[tmp11];
let tmp14 = null != tmp18;
if (tmp14) {
let tmp12 = require;
let tmp13 = dependencyMap;
2026-08-24 06:08:38 +00:00
tmp14 = tmp18.type === SidebarType.SidebarType.VIEW_CHANNEL;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp14) {
tmp14 = tmp18.channelId === channel.id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp14) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
let tmp15 = dependencyMap;
2026-07-23 10:11:24 +00:00
delete tmp4[tmp5];
2026-07-20 16:05:17 +00:00
flag = true;
continue;
}
continue;
}
}
return flag2;
}
2026-07-23 10:11:24 +00:00
const tmp6 = dependencyMap;
2026-07-20 16:05:17 +00:00
},
CHANNEL_SELECT: function handleChannelSelect() {
if (tmp) {
2026-08-24 06:08:38 +00:00
c16 = false;
c17 = false;
c18 = false;
2026-07-20 16:05:17 +00:00
}
},
THREAD_CREATE: function handleThreadCreate(channel) {
channel = channel.channel;
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
id = currentUser.id;
}
if (channel.ownerId === id) {
return false;
} else {
let tmp5 = null != tmp12;
if (tmp5) {
2026-08-24 06:08:38 +00:00
tmp5 = tmp12.type === SidebarType.SidebarType.CREATE_THREAD;
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
2026-08-24 06:08:38 +00:00
let obj = DISCORD_EPOCHDefault;
2026-07-20 16:05:17 +00:00
tmp5 = tmp12.parentMessageId === obj.castChannelIdAsMessageId(channel.id);
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
obj = { type: null, channelId: null };
2026-08-24 06:08:38 +00:00
obj[0] = SidebarType.SidebarType.VIEW_THREAD;
2026-07-29 08:29:29 +00:00
obj[1] = channel.id;
2026-07-23 10:11:24 +00:00
dependencyMap[channel.parent_id] = obj;
2026-07-20 16:05:17 +00:00
}
}
},
THREAD_DELETE: function handleThreadDelete(channel) {
channel = channel.channel;
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[channel.parent_id]) {
2026-08-24 06:08:38 +00:00
if (tmp3.type === SidebarType.SidebarType.VIEW_THREAD) {
2026-07-23 10:11:24 +00:00
if (tmp3.channelId === channel.id) {
2026-07-20 16:05:17 +00:00
const parent_id = channel.parent_id;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
}
}
}
return false;
}
2026-07-23 10:11:24 +00:00
});
2026-07-29 08:29:29 +00:00
const result = set.fileFinishedImporting("stores/ChannelSectionStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default channelSectionStore;
2026-07-20 16:05:17 +00:00
export const MESSAGE_REQUESTS_BASE_CHANNEL_ID = "message_requests";
export const isViewChannelSidebar = function isViewChannelSidebar(type) {
2026-08-24 06:08:38 +00:00
const items = [SidebarType.SidebarType.VIEW_CHANNEL, SidebarType.SidebarType.VIEW_THREAD, SidebarType.SidebarType.VIEW_MESSAGE_REQUEST, SidebarType.SidebarType.VIEW_MOD_REPORT];
2026-07-20 16:05:17 +00:00
return items.includes(type.type);
};