Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
59 lines
2.3 KiB
TypeScript
59 lines
2.3 KiB
TypeScript
// Module ID: 17492
|
|
// Function ID: 17493
|
|
// Name: MessageSessionMetadataManager
|
|
// Dependencies: [1074, 7221, 1242, 2]
|
|
|
|
// Module 17492 (MessageSessionMetadataManager)
|
|
import Constants from "Constants" /* 1074 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1242 */;
|
|
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const AnalyticEvents = Constants.AnalyticEvents;
|
|
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) {
|
|
const obj3 = { message_id: null, channel_id: null, author_id: null, authorized_application_ids: null };
|
|
({ id: obj2.message_id, channel_id: obj2.channel_id, author } = message);
|
|
let id;
|
|
if (author != null) {
|
|
id = author.id;
|
|
}
|
|
const self = this;
|
|
obj3.author_id = id;
|
|
obj3.authorized_application_ids = this._getAuthorizedApplicationIds(message.session_metadata);
|
|
AnalyticsUtilsDefault.track(AnalyticEvents.MESSAGE_DISPATCH_SESSION_METADATA_FOUND, obj3);
|
|
}
|
|
};
|
|
const messageSessionMetadataManager = new MessageSessionMetadataManager();
|
|
let result = size.fileFinishedImporting("modules/provisional_accounts/MessageSessionMetadataManager.tsx");
|
|
|
|
export default messageSessionMetadataManager;
|