decord/beta/source/modules/messages/tryInjectMessage.tsx
github-actions 84d017ff78 chore: update source for beta 348.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
2026-09-28 16:18:32 +00:00

79 lines
3.2 KiB
TypeScript

// Module ID: 11435
// Function ID: 11436
// Name: tryInjectMessage
// Dependencies: [502, 1074, 7171, 5058, 1385, 11436, 11437, 2]
// Exports: tryCreateInjectedMessage
// Module 11435 (tryInjectMessage)
import FlagUtils from "FlagUtils" /* 1385 */;
import MessageRecordUtils from "MessageRecordUtils" /* 5058 */;
import createMessageDefault from "createMessage" /* 7171 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
require = fn;
const Constants = fn(1074);
({ MessageFlags: closure_4, MessageStates: hasOwnProperty, MessageTypes: metroRequire } = Constants);
const map = new Map();
const size = fn(2);
let result = size.fileFinishedImporting("modules/messages/tryInjectMessage.tsx");
export const tryCreateInjectedMessage = function tryCreateInjectedMessage(id, id2) {
if (map.get(id2.id) === id.id) {
const obj3 = { channelId: id2.id, type: constants3.IN_GAME_MESSAGE_NUX, content: "", author: id.author, flags: constants.EPHEMERAL, state: constants2.SENT };
const tmp19 = createMessageDefault(obj3);
const messageRecord = MessageRecordUtils.createMessageRecord(tmp19);
({ applicationId: tmp21.applicationId, timestamp: tmp21.timestamp } = id);
let tmp4 = messageRecord;
} else {
tmp4 = null;
if (null != id.applicationId) {
tmp4 = null;
if (obj2.hasFlag(id.flags, constants.SENT_BY_SOCIAL_LAYER_INTEGRATION)) {
tmp4 = null;
if (id2.isDM()) {
tmp4 = null;
if (id.author.id !== AuthenticationStore.getId()) {
tmp4 = null;
if (null == id.activity) {
let num = id2.recipientFlags;
if (num == null) {
num = 0;
}
tmp4 = null;
if (!tmpResult.hasFlag(num, tmp(11436).ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX)) {
tmp4 = null;
if (!obj.has(id2.id)) {
const obj4 = { channelId: id2.id, type: constants3.IN_GAME_MESSAGE_NUX, content: "", author: id.author, flags: tmp3.EPHEMERAL, state: constants2.SENT };
const tmp6 = importDefault;
const tmp9 = createMessageDefault(obj4);
const messageRecord1 = tmp(5058).createMessageRecord(tmp9);
({ applicationId: tmp10.applicationId, timestamp: tmp10.timestamp } = id);
const result = obj.set(id2.id, id.id);
const tmpResult3 = tmp(5058);
let num2 = id2.recipientFlags;
if (num2 == null) {
num2 = 0;
}
const tmpResult4 = tmp(1385);
const setFlagResult = tmp(1385).setFlag(num2, tmp(11436).ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX, true);
const result1 = tmp6(11437).updatePrivateChannelRecipientFlags(id2.id, setFlagResult);
tmp4 = messageRecord1;
const tmp6Result = tmp6(11437);
}
}
tmpResult = tmp(1385);
}
}
}
}
obj2 = FlagUtils;
tmp3 = constants;
}
}
let tmp22 = null;
if (null != tmp4) {
const obj5 = { message: tmp4, position: "before" };
tmp22 = obj5;
}
return tmp22;
};