decord/source/modules/media_channel/MediaPostSharePromptStore.tsx

68 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8205
// Function ID: 8206
2026-07-29 08:29:29 +00:00
// Name: set
2026-08-24 06:08:38 +00:00
// Dependencies: [1982, 1218, 1391, 8206, 11, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 8205 (set)
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import useIsFirstMessageInMediaPost from "useIsFirstMessageInMediaPost" /* 8206 */;
import closure_3 from "isSubscriptionGated" /* 1982 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-23 10:11:24 +00:00
let set = new Set();
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class MediaPostSharePromptStore extends Store {
}
const prototype = MediaPostSharePromptStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_4, closure_5, closure_3);
2026-07-29 08:29:29 +00:00
};
prototype["shouldDisplayPrompt"] = function shouldDisplayPrompt(id) {
return set.has(id);
};
MediaPostSharePromptStore.displayName = "MediaPostSharePromptStore";
2026-08-24 06:08:38 +00:00
const mediaPostSharePromptStore = new MediaPostSharePromptStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
2026-08-24 06:08:38 +00:00
set = new Set();
2026-07-20 16:05:17 +00:00
},
MESSAGE_CREATE: function handleMessageCreate(isPushNotification) {
if (!isPushNotification.isPushNotification) {
const message = isPushNotification.message;
const author = message.author;
let id1;
2026-07-23 10:11:24 +00:00
id = id.getId();
2026-07-29 08:29:29 +00:00
if (author != null) {
2026-07-20 16:05:17 +00:00
id1 = author.id;
}
if (id === id1) {
if (obj2.isFirstMessageIdInMediaPost(message.id, message.channel_id)) {
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(message.channel_id);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (null != channel.parent_id) {
if (channelGated.isChannelGated(channel.guild_id, channel.parent_id)) {
2026-08-24 06:08:38 +00:00
set.add(DISCORD_EPOCHDefault.castMessageIdAsChannelId(isPushNotification.message.id));
const obj = DISCORD_EPOCHDefault;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-08-24 06:08:38 +00:00
obj2 = useIsFirstMessageInMediaPost;
2026-07-20 16:05:17 +00:00
}
}
},
DISMISS_MEDIA_POST_SHARE_PROMPT: function handleDismissMediaPostSharePrompt(threadId) {
set.delete(threadId.threadId);
},
LOGOUT: function handleLogout() {
set.clear();
}
});
2026-07-29 08:29:29 +00:00
const result = set.fileFinishedImporting("modules/media_channel/MediaPostSharePromptStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default mediaPostSharePromptStore;