decord/alpha/source/modules/messages/tryInjectMessage.tsx

80 lines
3.2 KiB
TypeScript
Raw Normal View History

// Module ID: 12210
// Function ID: 12211
// Name: tryInjectMessage
// Dependencies: [502, 1074, 7997, 4979, 1385, 12211, 12212, 2]
2026-07-20 16:05:17 +00:00
// Exports: tryCreateInjectedMessage
// Module 12210 (tryInjectMessage)
import FlagUtils from "FlagUtils" /* 1385 */;
import MessageRecordUtils from "MessageRecordUtils" /* 4979 */;
import createMessageDefault from "createMessage" /* 7997 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Constants = fn(1074);
({ MessageFlags: closure_4, MessageStates: hasOwnProperty, MessageTypes: metroRequire } = Constants);
2026-07-20 16:05:17 +00:00
const map = new Map();
const size = fn(2);
let result = size.fileFinishedImporting("modules/messages/tryInjectMessage.tsx");
2026-07-20 16:05:17 +00:00
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);
2026-07-29 08:29:29 +00:00
({ applicationId: tmp21.applicationId, timestamp: tmp21.timestamp } = id);
let tmp4 = messageRecord;
2026-07-20 16:05:17 +00:00
} else {
tmp4 = null;
if (null != id.applicationId) {
tmp4 = null;
if (obj2.hasFlag(id.flags, constants.SENT_BY_SOCIAL_LAYER_INTEGRATION)) {
2026-07-20 16:05:17 +00:00
tmp4 = null;
if (id2.isDM()) {
2026-07-20 16:05:17 +00:00
tmp4 = null;
if (id.author.id !== AuthenticationStore.getId()) {
2026-07-20 16:05:17 +00:00
tmp4 = null;
if (null == id.activity) {
let num = id2.recipientFlags;
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
tmp4 = null;
if (!tmpResult.hasFlag(num, tmp(12211).ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX)) {
2026-07-20 16:05:17 +00:00
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 };
2026-07-29 08:29:29 +00:00
const tmp6 = importDefault;
const tmp9 = createMessageDefault(obj4);
const messageRecord1 = tmp(4979).createMessageRecord(tmp9);
({ applicationId: tmp10.applicationId, timestamp: tmp10.timestamp } = id);
const result = obj.set(id2.id, id.id);
const tmpResult3 = tmp(4979);
let num2 = id2.recipientFlags;
2026-07-29 08:29:29 +00:00
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
const tmpResult4 = tmp(1385);
const setFlagResult = tmp(1385).setFlag(num2, tmp(12211).ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX, true);
const result1 = tmp6(12212).updatePrivateChannelRecipientFlags(id2.id, setFlagResult);
2026-07-29 08:29:29 +00:00
tmp4 = messageRecord1;
const tmp6Result = tmp6(12212);
2026-07-20 16:05:17 +00:00
}
}
tmpResult = tmp(1385);
2026-07-20 16:05:17 +00:00
}
}
}
}
obj2 = FlagUtils;
2026-07-29 08:29:29 +00:00
tmp3 = constants;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp22 = null;
2026-07-20 16:05:17 +00:00
if (null != tmp4) {
const obj5 = { message: tmp4, position: "before" };
tmp22 = obj5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp22;
2026-07-20 16:05:17 +00:00
};