Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
66 lines
2.4 KiB
TypeScript
66 lines
2.4 KiB
TypeScript
// Module ID: 8049
|
|
// Function ID: 8050
|
|
// Name: MediaPostSharePromptStore
|
|
// Dependencies: [2014, 502, 1958, 8050, 11, 504, 573, 2]
|
|
|
|
// Module 8049 (MediaPostSharePromptStore)
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
|
import initializeDefault from "initialize" /* 504 */;
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import useIsFirstMessageInMediaPost from "useIsFirstMessageInMediaPost" /* 8050 */;
|
|
import GatedChannelStore from "GatedChannelStore" /* 2014 */;
|
|
import AuthenticationStore from "AuthenticationStore" /* 502 */;
|
|
import ChannelStore from "ChannelStore" /* 1958 */;
|
|
|
|
require = fn;
|
|
let set = new Set();
|
|
const Store = initializeDefault.Store;
|
|
class MediaPostSharePromptStore extends Store {
|
|
}
|
|
const prototype = MediaPostSharePromptStore.prototype;
|
|
prototype["initialize"] = function initialize() {
|
|
this.waitFor(AuthenticationStore, ChannelStore, GatedChannelStore);
|
|
};
|
|
prototype["shouldDisplayPrompt"] = function shouldDisplayPrompt(id) {
|
|
return set.has(id);
|
|
};
|
|
MediaPostSharePromptStore.displayName = "MediaPostSharePromptStore";
|
|
const mediaPostSharePromptStore = new MediaPostSharePromptStore(DispatcherDefault, {
|
|
CONNECTION_OPEN: function handleConnectionOpen() {
|
|
set = new Set();
|
|
},
|
|
MESSAGE_CREATE: function handleMessageCreate(isPushNotification) {
|
|
if (!isPushNotification.isPushNotification) {
|
|
const message = isPushNotification.message;
|
|
const author = message.author;
|
|
let id1;
|
|
const id = AuthenticationStore.getId();
|
|
if (author != null) {
|
|
id1 = author.id;
|
|
}
|
|
if (id === id1) {
|
|
if (obj2.isFirstMessageIdInMediaPost(message.id, message.channel_id)) {
|
|
const channel = ChannelStore.getChannel(message.channel_id);
|
|
if (null != channel) {
|
|
if (null != channel.parent_id) {
|
|
if (GatedChannelStore.isChannelGated(channel.guild_id, channel.parent_id)) {
|
|
set.add(SnowflakeUtilsDefault.castMessageIdAsChannelId(isPushNotification.message.id));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
obj2 = useIsFirstMessageInMediaPost;
|
|
}
|
|
}
|
|
},
|
|
DISMISS_MEDIA_POST_SHARE_PROMPT: function handleDismissMediaPostSharePrompt(threadId) {
|
|
set.delete(threadId.threadId);
|
|
},
|
|
LOGOUT: function handleLogout() {
|
|
set.clear();
|
|
}
|
|
});
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/media_channel/MediaPostSharePromptStore.tsx");
|
|
|
|
export default mediaPostSharePromptStore;
|