decord/alpha/source/modules/messages/tryInjectMessage.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

79 lines
3.2 KiB
TypeScript

// Module ID: 11646
// Function ID: 11647
// Name: tryInjectMessage
// Dependencies: [502, 1074, 7344, 5067, 1385, 11647, 11648, 2]
// Exports: tryCreateInjectedMessage
// Module 11646 (tryInjectMessage)
import FlagUtils from "FlagUtils" /* 1385 */;
import MessageRecordUtils from "MessageRecordUtils" /* 5067 */;
import createMessageDefault from "createMessage" /* 7344 */;
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(11647).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(5067).createMessageRecord(tmp9);
({ applicationId: tmp10.applicationId, timestamp: tmp10.timestamp } = id);
const result = obj.set(id2.id, id.id);
const tmpResult3 = tmp(5067);
let num2 = id2.recipientFlags;
if (num2 == null) {
num2 = 0;
}
const tmpResult4 = tmp(1385);
const setFlagResult = tmp(1385).setFlag(num2, tmp(11647).ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX, true);
const result1 = tmp6(11648).updatePrivateChannelRecipientFlags(id2.id, setFlagResult);
tmp4 = messageRecord1;
const tmp6Result = tmp6(11648);
}
}
tmpResult = tmp(1385);
}
}
}
}
obj2 = FlagUtils;
tmp3 = constants;
}
}
let tmp22 = null;
if (null != tmp4) {
const obj5 = { message: tmp4, position: "before" };
tmp22 = obj5;
}
return tmp22;
};