decord/source/stores/ChannelPinsStore.tsx

246 lines
8.5 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 9821
2026-07-27 11:26:19 +00:00
// Function ID: 76145
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1922, 1348, 1918, 1838, 4350, 3768, 1850, 4352, 22, 5834, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 9821 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_4 from "_isNativeReflectConstruct";
import initialize from "initialize";
import set from "set";
import _inherits from "_inherits";
import closure_8 from "_isNativeReflectConstruct";
import closure_9 from "_isNativeReflectConstruct";
import closure_10 from "_isNativeReflectConstruct";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import closure_12 from "_isNativeReflectConstruct";
import closure_13 from "_isNativeReflectConstruct";
import closure_14 from "_isNativeReflectConstruct";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function handleChannelDelete(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
}
function handleRelationshipUpdate() {
2026-07-23 10:11:24 +00:00
let item = importDefault(22).forEach(closure_16, (items) => {
2026-07-20 16:05:17 +00:00
items = items.items;
const item = items.forEach((message) => {
message = message.message;
2026-07-23 10:11:24 +00:00
const result = message.set("blocked", outer2_13.isBlockedForMessage(message));
const result1 = message.set("ignored", outer2_13.isIgnoredForMessage(message));
2026-07-20 16:05:17 +00:00
});
const items1 = items.items;
items.items = items1.slice();
});
}
let obj = { LOADING: "LOADING", LOADED_HAS_MORE: "LOADED_HAS_MORE", LOADED_FINISHED: "LOADING_FINISHED", FAILED: "FAILED" };
let closure_16 = {};
2026-07-23 10:11:24 +00:00
let tmp2 = ((Store) => {
2026-07-20 16:05:17 +00:00
class ChannelPinsStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, ChannelPinsStore);
obj = outer1_6(ChannelPinsStore);
tmp2 = outer1_5;
if (outer1_17()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(ChannelPinsStore, Store);
let obj = {
key: "initialize",
value() {
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_9, outer1_10, outer1_11, outer1_8, outer1_12, outer1_13, outer1_14);
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, ];
obj = {
key: "getPins",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_16[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
return callback(ChannelPinsStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").Store);
2026-07-20 16:05:17 +00:00
tmp2.displayName = "ChannelPinsStore";
obj = {
CONNECTION_OPEN: function handleConnectionOpen() {
let closure_16 = {};
},
LOAD_PINNED_MESSAGES: function handleLoadStart(channelId) {
channelId = channelId.channelId;
if (!channelId.reset) {
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[channelId]) {
dependencyMap[channelId].state = obj.LOADING;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(channelId);
2026-07-20 16:05:17 +00:00
let guildId;
if (null != channel) {
guildId = channel.getGuildId();
}
let tmp6;
if (null != guildId) {
tmp6 = guildId;
}
2026-07-23 10:11:24 +00:00
obj = { id: channelId, items: [], state: obj.LOADING, guildId: tmp6 };
dependencyMap[channelId] = obj;
2026-07-20 16:05:17 +00:00
},
LOAD_PINNED_MESSAGES_SUCCESS: function handleLoadSuccess(pins) {
pins = pins.pins;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[pins.channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const mapped = pins.map((pinned_at) => {
const obj = { pinnedAt: new Date(Date.parse(pinned_at.pinned_at)) };
const date = new Date(Date.parse(pinned_at.pinned_at));
2026-07-23 10:11:24 +00:00
obj.message = outer1_0(outer1_2[12]).createMessageRecord(pinned_at.message);
2026-07-20 16:05:17 +00:00
return obj;
});
const items = [];
HermesBuiltin.arraySpread(mapped, HermesBuiltin.arraySpread(tmp2.items, 0));
tmp2.items = items;
tmp2.state = tmp ? obj.LOADED_HAS_MORE : obj.LOADED_FINISHED;
}
},
LOAD_PINNED_MESSAGES_FAILURE: function handleLoadFail(arg0) {
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[arg0.channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
tmp.state = obj.FAILED;
}
},
CHANNEL_DELETE: handleChannelDelete,
THREAD_DELETE: handleChannelDelete,
GUILD_DELETE: function handleGuildDelete(guild) {
2026-07-23 10:11:24 +00:00
guild = guild.guild;
const found = importDefault(22)(closure_16).filter((guildId) => guildId.guildId !== guild.id);
const arr = importDefault(22)(closure_16);
2026-07-20 16:05:17 +00:00
closure_16 = found.keyBy("id").value();
},
MESSAGE_DELETE: function handleMessageDelete(arg0) {
let channelId;
2026-07-23 10:11:24 +00:00
let require;
({ id: require, channelId } = arg0);
2026-07-20 16:05:17 +00:00
let tmp2 = null != tmp;
if (tmp2) {
2026-07-23 10:11:24 +00:00
const tmp5 = 0 !== importDefault(22).remove(tmp.items, (message) => message.message.id === closure_0).length;
2026-07-20 16:05:17 +00:00
if (tmp5) {
const items = tmp.items;
tmp.items = items.slice();
2026-07-23 10:11:24 +00:00
dependencyMap[channelId] = tmp;
2026-07-20 16:05:17 +00:00
}
tmp2 = tmp5;
2026-07-23 10:11:24 +00:00
const obj = importDefault(22);
2026-07-20 16:05:17 +00:00
}
return tmp2;
},
MESSAGE_DELETE_BULK: function handleMessageDeleteBulk(ids) {
2026-07-23 10:11:24 +00:00
ids = ids.ids;
if (null == dependencyMap[ids.channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const items = tmp.items;
tmp.items = items.filter((message) => !ids.includes(message.message.id));
}
},
MESSAGE_UPDATE: function handleMessageUpdate(message) {
2026-07-23 10:11:24 +00:00
const id = message.message.id;
2026-07-20 16:05:17 +00:00
const channel_id = message.message.channel_id;
if (null == channel_id) {
return false;
2026-07-23 10:11:24 +00:00
} else if (null == dependencyMap[channel_id]) {
2026-07-20 16:05:17 +00:00
return false;
} else if (null != message.message.author) {
if (message.message.pinned) {
const items = tmp23.items;
tmp23.items = items.slice();
2026-07-23 10:11:24 +00:00
const findIndexResult = importDefault(22).findIndex(tmp23.items, (message) => message.message.id === id);
2026-07-20 16:05:17 +00:00
if (-1 === findIndexResult) {
const items1 = tmp23.items;
2026-07-25 08:10:48 +00:00
let obj = { message: id(4352).createMessageRecord(message.message) };
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date();
obj.pinnedAt = date;
items1.unshift(obj);
2026-07-25 08:10:48 +00:00
const obj6 = id(4352);
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
tmp23.items[findIndexResult].message = id(4352).updateMessageRecord(tmp23.items[findIndexResult].message, message.message);
const obj4 = id(4352);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj3 = importDefault(22);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const findIndexResult1 = importDefault(22).findIndex(tmp23.items, (message) => message.message.id === id);
2026-07-20 16:05:17 +00:00
if (-1 === findIndexResult1) {
return false;
} else {
const items2 = tmp23.items;
tmp23.items = items2.slice();
const items3 = tmp23.items;
items3.splice(findIndexResult1, 1);
}
2026-07-23 10:11:24 +00:00
const obj2 = importDefault(22);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-23 10:11:24 +00:00
const findIndexResult2 = importDefault(22).findIndex(tmp23.items, (message) => message.message.id === id);
2026-07-20 16:05:17 +00:00
if (-1 !== findIndexResult2) {
message = tmp.message;
2026-07-25 08:10:48 +00:00
obj = id(4352);
2026-07-20 16:05:17 +00:00
const updateMessageRecordResult = obj.updateMessageRecord(message, message.message);
if (updateMessageRecordResult !== message) {
const items4 = tmp23.items;
const substr = items4.slice();
obj = { pinnedAt: tmp.pinnedAt, message: updateMessageRecordResult };
substr[findIndexResult2] = obj;
2026-07-23 10:11:24 +00:00
dependencyMap[channel_id].items = substr;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
const obj7 = importDefault(22);
2026-07-20 16:05:17 +00:00
}
},
RELATIONSHIP_ADD: handleRelationshipUpdate,
RELATIONSHIP_REMOVE: handleRelationshipUpdate,
RELATIONSHIP_UPDATE: handleRelationshipUpdate,
MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT: function handleScanTimeout(messageId) {
2026-07-23 10:11:24 +00:00
messageId = messageId.messageId;
if (null == dependencyMap[messageId.channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
const findIndexResult = importDefault(22).findIndex(tmp.items, (message) => message.message.id === messageId);
2026-07-20 16:05:17 +00:00
if (-1 === findIndexResult) {
return false;
} else {
const items = tmp.items;
tmp.items = items.slice();
2026-07-25 08:10:48 +00:00
tmp.items[findIndexResult].message = messageId(5834).handleExplicitMediaScanTimeoutForMessage(tmp.items[findIndexResult].message);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const obj2 = importDefault(22);
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2(require("dispatcher"), obj);
let result = require("_possibleConstructorReturn").fileFinishedImporting("stores/ChannelPinsStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;
export const FetchState = obj;