60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
// Metro module 12812 (f12813).
|
|
import HotspotStore from "../../modules/hotspot/HotspotStore";
|
|
import GuildStore from "../GuildStore";
|
|
import { GuildFeatures } from "../../Constants";
|
|
import Module589 from "../../_bundle/Module589";
|
|
import Dispatcher from "../../Dispatcher";
|
|
let c8838_3, handleHotspotUpdates;
|
|
const checkGuildIsHub = function checkGuildIsHub(id) {
|
|
const guild = GuildStore.getGuild(id);
|
|
let r8 = guild != null;
|
|
if (r8) {
|
|
let r14 = !!guild.features.has(GuildFeatures.HUB);
|
|
if (r14) {
|
|
c8838_3 = true;
|
|
r14 = true;
|
|
}
|
|
r8 = r14;
|
|
}
|
|
return r8;
|
|
};
|
|
handleHotspotUpdates = function handleHotspotUpdates() {
|
|
return true;
|
|
};
|
|
c8838_3 = false;
|
|
class HubLinkNoticeStore extends Module589.Store {
|
|
static displayName = "HubLinkNoticeStore";
|
|
initialize() {
|
|
this.waitFor(GuildStore, HotspotStore);
|
|
this.syncWith([HotspotStore], handleHotspotUpdates);
|
|
}
|
|
channelNoticePredicate(a0) {
|
|
return !!a0.features.has(GuildFeatures.LINKED_TO_HUB) && !c8838_3;
|
|
}
|
|
}
|
|
const hubLinkNoticeStore = new HubLinkNoticeStore(Dispatcher, {
|
|
CONNECTION_OPEN: function handleConnectionOpen(a0) {
|
|
for (const guild of a0.guilds) {
|
|
if (!checkGuildIsHub(guild.id)) {
|
|
continue;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
},
|
|
GUILD_CREATE: function handleGuildCreate(a0) {
|
|
const guild = GuildStore.getGuild(a0.guild.id);
|
|
let r10 = guild != null;
|
|
if (r10) {
|
|
let r16 = !!guild.features.has(GuildFeatures.HUB);
|
|
if (r16) {
|
|
c8838_3 = true;
|
|
r16 = true;
|
|
}
|
|
r10 = r16;
|
|
}
|
|
return r10;
|
|
}
|
|
});
|
|
export default hubLinkNoticeStore;
|