decord/source/modules/provisional_accounts/MessageSessionMetadataManager.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

61 lines
2.2 KiB
TypeScript

// Module ID: 17379
// Function ID: 17380
// Name: handleMessageCreate
// Dependencies: [1074, 7118, 1242, 2]
// Module 17379 (handleMessageCreate)
import set from "set" /* 2 */;
import ME from "ME" /* 1074 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 1242 */;
import initializeDefault from "initialize" /* 7118 */;
const AnalyticEvents = ME.AnalyticEvents;
initializeDefault;
class MessageSessionMetadataManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.actions = {
MESSAGE_CREATE(arg0) {
return applyArgumentsResult.handleMessageCreate(arg0);
},
MESSAGE_UPDATE(arg0) {
return applyArgumentsResult.handleMessageUpdate(arg0);
}
};
return applyArgumentsResult;
}
}
const prototype = MessageSessionMetadataManager.prototype;
prototype["handleMessageCreate"] = function handleMessageCreate(message) {
const result = this._trackIfSessionMetadataExists(message.message);
};
prototype["handleMessageUpdate"] = function handleMessageUpdate(message) {
const result = this._trackIfSessionMetadataExists(message.message);
};
prototype["_getAuthorizedApplicationIds"] = function _getAuthorizedApplicationIds(session_metadata) {
try {
return session_metadata.authorized_application_ids;
} catch (err) {
return null;
}
};
prototype["_trackIfSessionMetadataExists"] = function _trackIfSessionMetadataExists(message) {
if (null != message.session_metadata) {
let obj = expandEventPropertiesDefault;
obj = { message_id: null, channel_id: null, author_id: null, authorized_application_ids: null };
({ id: obj2[0], channel_id: obj2[1], author } = message);
let id;
if (author != null) {
id = author.id;
}
const self = this;
obj[2] = id;
obj[3] = this._getAuthorizedApplicationIds(message.session_metadata);
obj.track(AnalyticEvents.MESSAGE_DISPATCH_SESSION_METADATA_FOUND, obj);
}
};
const messageSessionMetadataManager = new MessageSessionMetadataManager();
let result = set.fileFinishedImporting("modules/provisional_accounts/MessageSessionMetadataManager.tsx");
export default messageSessionMetadataManager;