decord/source/modules/media_channel/MediaPostSharePromptStore.tsx
github-actions 8d58bae3b2 chore: update source for alpha 347.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
2026-09-18 06:58:00 +00:00

66 lines
2.4 KiB
TypeScript

// Module ID: 8161
// Function ID: 8162
// Name: MediaPostSharePromptStore
// Dependencies: [2014, 502, 1958, 8162, 11, 504, 573, 2]
// Module 8161 (MediaPostSharePromptStore)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import useIsFirstMessageInMediaPost from "useIsFirstMessageInMediaPost" /* 8162 */;
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;