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

87 lines
3.6 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 12372
// Function ID: 12373
// Name: tryInjectMessage
2026-10-13 12:43:34 +00:00
// Dependencies: [502, 1085, 9812, 5434, 1403, 12373, 12374, 2]
2026-07-20 16:05:17 +00:00
// Exports: tryCreateInjectedMessage
2026-10-13 12:43:34 +00:00
// Module 12372 (tryInjectMessage)
2026-10-09 10:00:15 +00:00
import FlagUtils from "FlagUtils" /* 1403 */;
2026-10-10 08:08:14 +00:00
import MessageRecordUtils from "MessageRecordUtils" /* 5434 */;
2026-10-12 06:59:38 +00:00
import createMessageDefault from "createMessage" /* 9812 */;
2026-10-13 12:43:34 +00:00
import ChannelRecipientPrivateUserDataFlags from "ChannelRecipientPrivateUserDataFlags" /* 12373 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let closure_4;
let hasOwnProperty;
let metroRequire;
({ MessageFlags: closure_4, MessageStates: hasOwnProperty, MessageTypes: metroRequire } = Constants);
2026-07-20 16:05:17 +00:00
const map = new Map();
let result = size.fileFinishedImporting("modules/messages/tryInjectMessage.tsx");
2026-07-20 16:05:17 +00:00
export const tryCreateInjectedMessage = function tryCreateInjectedMessage(id, id2) {
2026-10-03 08:58:59 +00:00
let tmp4;
if (map.get(id2.id) === id.id) {
2026-10-03 08:58:59 +00:00
const obj3 = { channelId: id2.id, type: metroRequire.IN_GAME_MESSAGE_NUX, content: "", author: id.author, flags: constants.EPHEMERAL, state: hasOwnProperty.SENT };
const tmp21 = createMessageDefault(obj3);
const obj7 = MessageRecordUtils;
const messageRecord = obj7.createMessageRecord(tmp21);
({ applicationId: tmp23.applicationId, timestamp: tmp23.timestamp } = id);
tmp4 = messageRecord;
2026-07-20 16:05:17 +00:00
} else {
tmp4 = null;
if (null != id.applicationId) {
tmp4 = null;
2026-10-03 08:58:59 +00:00
const obj2 = FlagUtils;
const tmp3 = constants;
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-10-03 08:58:59 +00:00
const hasFlag = FlagUtils.hasFlag;
FlagUtils;
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
tmp4 = null;
2026-10-03 08:58:59 +00:00
if (!hasFlag(num, ChannelRecipientPrivateUserDataFlags.ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX)) {
2026-07-20 16:05:17 +00:00
tmp4 = null;
2026-10-03 08:58:59 +00:00
if (!map.has(id2.id)) {
const obj4 = { channelId: id2.id, type: metroRequire.IN_GAME_MESSAGE_NUX, content: "", author: id.author, flags: tmp3.EPHEMERAL, state: hasOwnProperty.SENT };
const tmp10 = createMessageDefault(obj4);
const tmpResult3 = MessageRecordUtils;
const messageRecord1 = tmpResult3.createMessageRecord(tmp10);
({ applicationId: tmp11.applicationId, timestamp: tmp11.timestamp } = id);
const result = obj.set(id2.id, id.id);
let num2 = id2.recipientFlags;
2026-10-03 08:58:59 +00:00
const setFlag = FlagUtils.setFlag;
FlagUtils;
const tmp7 = importDefault;
2026-07-29 08:29:29 +00:00
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const setFlagResult = setFlag(num2, ChannelRecipientPrivateUserDataFlags.ChannelRecipientPrivateUserDataFlags.DISMISSED_IN_GAME_MESSAGE_NUX, true);
2026-10-13 12:43:34 +00:00
const tmp7Result = tmp7(12374);
2026-10-03 08:58:59 +00:00
const result1 = tmp7Result.updatePrivateChannelRecipientFlags(id2.id, setFlagResult);
2026-07-29 08:29:29 +00:00
tmp4 = messageRecord1;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
}
2026-10-03 08:58:59 +00:00
let tmp24 = null;
2026-07-20 16:05:17 +00:00
if (null != tmp4) {
2026-10-03 08:58:59 +00:00
tmp24 = { message: tmp4, position: "before" };
const obj5 = { message: tmp4, position: "before" };
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp24;
2026-07-20 16:05:17 +00:00
};