1132 lines
55 KiB
TypeScript
1132 lines
55 KiB
TypeScript
/* Metro module 13013; source: modules/rpc/server/RPCServerManager.tsx; dependencies: [57, 6, 7, 7093, 1379, 1945, 1867, 4259, 4396, 4294, 3793, 1934, 1878, 4297, 661, 4237, 8066, 4291, 1360, 8081, 8095, 13014, 8082, 7116, 477, 694, 683, 566, 2] */
|
|
function _fun99302(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6, offset: 0x021c36ac, size: 480 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_99305 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
|
|
const presenceStore = importDefault(4396) /* metro dependency 4396: PresenceStore */;
|
|
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_17 = value.ActivityActionTypes;
|
|
const env0_18 = value.RelationshipTypes;
|
|
const env0_19 = value.AnalyticEvents;
|
|
const env0_20 = value.RPCEvents;
|
|
const env0_21 = value.RPCCloseCodes;
|
|
const env0_22 = (require(4237) /* metro dependency 4237: Constants */).ActivityLayoutMode;
|
|
const env0_23 = (require(8066) /* metro dependency 8066: FramesConstants */).FrameLayoutModes;
|
|
const env0_24 = (require(4291) /* metro dependency 4291: Constants */).MediaEngineContextTypes;
|
|
value = _fun99306();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/rpc/server/RPCServerManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_99303(a0, a1) { // fn#99303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:449, offset: 0x021c388c, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun99304;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_99305(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_99305(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_99305(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun99304;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function _fun99306() { // fn#99306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:1365, offset: 0x021c3a00, size: 111 bytes, params: 1, frame: 15
|
|
return env0_5(RPCServerManager, [{key: 'loadServer', value: value_99357}, {key: 'init', value: value_99358},
|
|
{key: 'terminate', value: value_99363}]);
|
|
}
|
|
|
|
function RPCServerManager({server, transports, commands, events, stores, registerTransportsForEmbeddedPlatform}) { // fn#99307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:1386, offset: 0x021c3a6f, size: 424 bytes, params: 2, frame: 15
|
|
env1_4(this, RPCServerManager);
|
|
this.handleMessage = handleMessage_99308;
|
|
this.handleSpeaking = handleSpeaking;
|
|
this.handleVoiceChannelSelect = handleVoiceChannelSelect_99310;
|
|
this.handleNotificationCreate = handleNotificationCreate;
|
|
this.handleActivityJoin = handleActivityJoin;
|
|
this.handleActivityLayoutModeUpdate = handleActivityLayoutModeUpdate;
|
|
this.handleFrameUpdateLayoutMode = handleFrameUpdateLayoutMode;
|
|
this.handleThermalStateChange = handleThermalStateChange;
|
|
this.handleScreenOrientationUpdate = handleScreenOrientationUpdate;
|
|
this.handleEmbeddedActivityUpdate = handleEmbeddedActivityUpdate;
|
|
this.handleActivityMessage = handleActivityMessage;
|
|
this.handleOAuth2TokenRevoke = function({accessToken}) {
|
|
accessToken.rpcServer.sockets.forEach(_fun99331);
|
|
};
|
|
this.handleGuildCreate = handleGuildCreate_99332;
|
|
this.handleChannelCreate = handleChannelCreate_99333;
|
|
this.handleLogout = handleLogout_99334;
|
|
this.handleRelationshipAdd = handleRelationshipAdd_99336;
|
|
this.handleRelationshipUpdate = handleRelationshipUpdate;
|
|
this.handleRelationshipRemove = handleRelationshipRemove;
|
|
this.handlePresenceUpdates = handlePresenceUpdates_99342;
|
|
this.handlePresencesReplace = handlePresencesReplace;
|
|
this.handleUserUpdate = handleUserUpdate_99349;
|
|
this.handleEntitlementCreate = handleEntitlementCreate;
|
|
this.handleEntitlementDelete = handleEntitlementDelete;
|
|
this.handleQuestEnrollSuccess = handleQuestEnrollSuccess;
|
|
this.rpcServer = server;
|
|
this.transports = transports;
|
|
this.rpcCommandHandlers = commands;
|
|
this.rpcEventHandlers = events;
|
|
this.stores = stores;
|
|
this.registerTransportsForEmbeddedPlatform = registerTransportsForEmbeddedPlatform;
|
|
}
|
|
|
|
function value_99357() { // fn#99357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:10024, offset: 0x021c4f14, size: 307 bytes, params: 1, frame: 22
|
|
var r2;
|
|
var r3;
|
|
var registerTransportsForEmbeddedPlatform;
|
|
var value4;
|
|
var rpcServer;
|
|
var registerTransport;
|
|
var value5;
|
|
var property;
|
|
var value8;
|
|
var property2;
|
|
var setCommandHandler;
|
|
var value9;
|
|
var value11;
|
|
var property3;
|
|
var setEventHandler;
|
|
var value12;
|
|
reducibleJoin2: while (true) {
|
|
if ((require(477) /* metro dependency 477: PlatformUtils */).isPlatformEmbedded) {
|
|
registerTransportsForEmbeddedPlatform = this.registerTransportsForEmbeddedPlatform;
|
|
Reflect.apply(registerTransportsForEmbeddedPlatform, this, []);
|
|
break reducibleJoin2;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
const value2 = _createForOfIteratorHelperLoose_99303(this.transports);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r2 = value3;
|
|
reducibleLoop3: while (true) {
|
|
value4 = r2.value;
|
|
rpcServer = this.rpcServer;
|
|
registerTransport = rpcServer.registerTransport;
|
|
Reflect.apply(registerTransport, rpcServer, [value4]);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop3;
|
|
}
|
|
r2 = value5;
|
|
continue reducibleLoop3;
|
|
}
|
|
}
|
|
const rpcCommandHandlers = this.rpcCommandHandlers;
|
|
let Object = global.Object;
|
|
const value6 = Object.entries(rpcCommandHandlers);
|
|
let length = value6.length;
|
|
const value7 = 0;
|
|
if (value7 < length) {
|
|
r3 = value7;
|
|
reducibleLoop5: while (true) {
|
|
property = value6[r3];
|
|
value8 = env1_3(property, 2);
|
|
property = value8[value7];
|
|
property2 = value8[1];
|
|
rpcServer = this.rpcServer;
|
|
setCommandHandler = rpcServer.setCommandHandler;
|
|
Reflect.apply(setCommandHandler, rpcServer, [property, property2]);
|
|
value9 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
|
|
length = value6.length;
|
|
if (value9 < length) {
|
|
r3 = value9;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
const rpcEventHandlers = this.rpcEventHandlers;
|
|
Object = global.Object;
|
|
const value10 = Object.entries(rpcEventHandlers);
|
|
length = value10.length;
|
|
if (value7 < length) {
|
|
r2 = value7;
|
|
reducibleLoop7: while (true) {
|
|
property = value10[r2];
|
|
value11 = env1_3(property, 2);
|
|
property = value11[value7];
|
|
property3 = value11[1];
|
|
rpcServer = this.rpcServer;
|
|
setEventHandler = rpcServer.setEventHandler;
|
|
Reflect.apply(setEventHandler, rpcServer, [property, property3]);
|
|
value12 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value10.length;
|
|
if (value12 < length) {
|
|
r2 = value12;
|
|
continue reducibleLoop7;
|
|
}
|
|
break reducibleLoop7;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_99358() { // fn#99358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:10557, offset: 0x021c5047, size: 1005 bytes, params: 1, frame: 18
|
|
var environment;
|
|
this.rpcServer.getCurrentUser = function() {
|
|
return UserStore.getCurrentUser();
|
|
};
|
|
this.rpcServer.onConnect = onConnect_99360;
|
|
this.rpcServer.onDisconnect = onDisconnect;
|
|
let value = environment.__proto__;
|
|
const items2 = [ChannelStore];
|
|
items2[1] = GuildMemberStore;
|
|
items2[2] = PresenceStore;
|
|
items2[3] = VoiceStateStore;
|
|
items2[4] = MediaEngineStore;
|
|
items2[5] = RTCConnectionStore;
|
|
const BatchedStoreListener = (require(566) /* metro dependency 566: flux */).BatchedStoreListener;
|
|
const value2 = items2.concat(this.stores);
|
|
const value3 = Object.create(BatchedStoreListener.prototype, {constructor: {value: BatchedStoreListener}});
|
|
const batchedStoreListener = new BatchedStoreListener(value2, _fun99362);
|
|
(batchedStoreListener instanceof Object ? batchedStoreListener : value3).attach('RPCServerManager');
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('MESSAGE_CREATE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('MESSAGE_UPDATE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('MESSAGE_DELETE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('SPEAKING', this.handleSpeaking);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('OAUTH2_TOKEN_REVOKE', this.handleOAuth2TokenRevoke);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('GUILD_CREATE', this.handleGuildCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('CHANNEL_CREATE', this.handleChannelCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('LOGOUT', this.handleLogout);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('VOICE_CHANNEL_SELECT', this.handleVoiceChannelSelect);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('RPC_NOTIFICATION_CREATE', this.handleNotificationCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('ACTIVITY_JOIN', this.handleActivityJoin);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('ACTIVITY_LAYOUT_MODE_UPDATE', this.handleActivityLayoutModeUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('FRAME_UPDATE_LAYOUT_MODE', this.handleFrameUpdateLayoutMode);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('THERMAL_STATE_CHANGE', this.handleThermalStateChange);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('ACTIVITY_SCREEN_ORIENTATION_UPDATE', this.handleScreenOrientationUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('EMBEDDED_ACTIVITY_UPDATE', this.handleEmbeddedActivityUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('RELATIONSHIP_ADD', this.handleRelationshipAdd);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('RELATIONSHIP_UPDATE', this.handleRelationshipUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('RELATIONSHIP_REMOVE', this.handleRelationshipRemove);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('PRESENCE_UPDATES', this.handlePresenceUpdates);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('PRESENCES_REPLACE', this.handlePresencesReplace);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('USER_UPDATE', this.handleUserUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('ENTITLEMENT_CREATE', this.handleEntitlementCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('ENTITLEMENT_DELETE', this.handleEntitlementDelete);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.subscribe('QUESTS_ENROLL_SUCCESS', this.handleQuestEnrollSuccess);
|
|
}
|
|
|
|
function value_99363() { // fn#99363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:12834, offset: 0x021c5530, size: 808 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('MESSAGE_CREATE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('MESSAGE_UPDATE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('MESSAGE_DELETE', this.handleMessage);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('SPEAKING', this.handleSpeaking);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('OAUTH2_TOKEN_REVOKE', this.handleOAuth2TokenRevoke);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('GUILD_CREATE', this.handleGuildCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('CHANNEL_CREATE', this.handleChannelCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('LOGOUT', this.handleLogout);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('VOICE_CHANNEL_SELECT', this.handleVoiceChannelSelect);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('RPC_NOTIFICATION_CREATE', this.handleNotificationCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ACTIVITY_JOIN', this.handleActivityJoin);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ACTIVITY_LAYOUT_MODE_UPDATE', this.handleActivityLayoutModeUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('FRAME_UPDATE_LAYOUT_MODE', this.handleFrameUpdateLayoutMode);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('THERMAL_STATE_CHANGE', this.handleThermalStateChange);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ACTIVITY_SCREEN_ORIENTATION_UPDATE', this.handleScreenOrientationUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('EMBEDDED_ACTIVITY_UPDATE', this.handleEmbeddedActivityUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('RELATIONSHIP_ADD', this.handleRelationshipAdd);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('RELATIONSHIP_UPDATE', this.handleRelationshipUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('RELATIONSHIP_REMOVE', this.handleRelationshipRemove);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('PRESENCE_UPDATES', this.handlePresenceUpdates);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('PRESENCES_REPLACE', this.handlePresencesReplace);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('USER_UPDATE', this.handleUserUpdate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ENTITLEMENT_CREATE', this.handleEntitlementCreate);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('ENTITLEMENT_DELETE', this.handleEntitlementDelete);
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.unsubscribe('QUESTS_ENROLL_SUCCESS', this.handleQuestEnrollSuccess);
|
|
}
|
|
|
|
function RPCServerManagerHandleMessage(a0) { // fn#99308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:1470, owner: RPCServerManager.handleMessage, offset: 0x021c3c17, size: 405 bytes, params: 2, frame: 22
|
|
var r4;
|
|
var r5;
|
|
var r6;
|
|
var value2;
|
|
var MESSAGE_DELETE;
|
|
var channelId;
|
|
var object3;
|
|
var id;
|
|
var value4;
|
|
var MESSAGE_UPDATE;
|
|
var message;
|
|
var channel_id;
|
|
var value6;
|
|
var MESSAGE_CREATE;
|
|
var dispatchToSubscriptions;
|
|
var object4;
|
|
var value;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length === 0) {
|
|
return undefined;
|
|
}
|
|
let type = a0.type;
|
|
if (type === 'MESSAGE_CREATE') {
|
|
env0_0.handleActivityMessage(a0);
|
|
}
|
|
type = a0.type;
|
|
if (type === 'MESSAGE_CREATE') {
|
|
message = a0.message;
|
|
if (message.state === 'SENDING') {
|
|
return undefined;
|
|
}
|
|
value6 = environment.__proto__.__proto__;
|
|
MESSAGE_CREATE = RPCEvents.MESSAGE_CREATE;
|
|
channelId = a0.channelId;
|
|
message = a0.message;
|
|
r4 = '' + MESSAGE_CREATE + a0.message.id;
|
|
r5 = MESSAGE_CREATE;
|
|
r6 = channelId;
|
|
if (r6 != null) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
object3 = {channel_id: r6};
|
|
object4 = {channel_id: r6};
|
|
value = environment.__proto__.__proto__;
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
object4.message = value.transformInternalTextMessage(message);
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [r5, object3, object4, r4]);
|
|
}
|
|
return undefined;
|
|
}
|
|
if (type === 'MESSAGE_UPDATE') {
|
|
value4 = environment.__proto__.__proto__;
|
|
MESSAGE_UPDATE = RPCEvents.MESSAGE_UPDATE;
|
|
message = a0.message;
|
|
channel_id = message.channel_id;
|
|
message = a0.message;
|
|
r4 = null;
|
|
r5 = MESSAGE_UPDATE;
|
|
r6 = channel_id;
|
|
if (r6 != null) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
object3 = {channel_id: r6};
|
|
object4 = {channel_id: r6};
|
|
value = environment.__proto__.__proto__;
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
object4.message = value.transformInternalTextMessage(message);
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [r5, object3, object4, r4]);
|
|
}
|
|
return undefined;
|
|
}
|
|
if (type === 'MESSAGE_DELETE') {
|
|
value2 = environment.__proto__.__proto__;
|
|
MESSAGE_DELETE = RPCEvents.MESSAGE_DELETE;
|
|
channelId = a0.channelId;
|
|
object3 = {};
|
|
id = a0.id;
|
|
object3.id = id;
|
|
id = a0.id;
|
|
r4 = '' + MESSAGE_DELETE + id;
|
|
r5 = MESSAGE_DELETE;
|
|
r6 = channelId;
|
|
if (r6 != null) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
object3 = {channel_id: r6};
|
|
object4 = {channel_id: r6};
|
|
value = environment.__proto__.__proto__;
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
object4.message = value.transformInternalTextMessage(object3);
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [r5, object3, object4, r4]);
|
|
}
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
return (require(1360) /* metro dependency 1360: GlobalUtils */).assertNever(a0);
|
|
}
|
|
|
|
function RPCServerManagerHandleSpeaking(a0) { // fn#99309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:2109, owner: RPCServerManager.handleSpeaking, offset: 0x021c3dac, size: 239 bytes, params: 2, frame: 18
|
|
var r4;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
r4 = a0.speakingFlags !== 0 ? RPCEvents.SPEAKING_START : RPCEvents.SPEAKING_STOP;
|
|
var context = a0.context;
|
|
var DEFAULT = MediaEngineContextTypes.DEFAULT;
|
|
if (context !== DEFAULT) {
|
|
return undefined;
|
|
}
|
|
var voiceChannelId = SelectedChannelStore.getVoiceChannelId();
|
|
if (voiceChannelId == null) {
|
|
return undefined;
|
|
}
|
|
var channel = ChannelStore.getChannel(voiceChannelId);
|
|
if (channel == null) {
|
|
return undefined;
|
|
}
|
|
var getVoiceState = VoiceStateStore.getVoiceState;
|
|
var guildId = channel.getGuildId();
|
|
var userId = a0.userId;
|
|
var value8 = Reflect.apply(getVoiceState, VoiceStateStore, [guildId, userId]);
|
|
if (value8 == null) {
|
|
return undefined;
|
|
}
|
|
rpcServer = env0_0.rpcServer;
|
|
var dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
var object2 = {};
|
|
var channelId = value8.channelId;
|
|
object2.channel_id = channelId;
|
|
channelId = value8.channelId;
|
|
userId = a0.userId;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [r4, object2, {channel_id: channelId, user_id: userId}]);
|
|
}
|
|
}
|
|
|
|
function RPCServerManagerHandleVoiceChannelSelect({guildId, channelId}) { // fn#99310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:2530, owner: RPCServerManager.handleVoiceChannelSelect, offset: 0x021c3e9b, size: 95 bytes, params: 2, frame: 16
|
|
var dispatchToSubscriptions;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.VOICE_CHANNEL_SELECT, {}, {channel_id: channelId,
|
|
guild_id: guildId}]);
|
|
}
|
|
}
|
|
|
|
function handleNotificationCreate({channelId, message, icon, title, body}) { // fn#99311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:2722, owner: RPCServerManager.handleNotificationCreate, offset: 0x021c3efa, size: 196 bytes, params: 2, frame: 23
|
|
var r6;
|
|
var dispatchToSubscriptions;
|
|
var NOTIFICATION_CREATE;
|
|
var object2;
|
|
var value2;
|
|
var value;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
NOTIFICATION_CREATE = RPCEvents.NOTIFICATION_CREATE;
|
|
object2 = {channel_id: channelId};
|
|
object2.message = (require(8081) /* metro dependency 8081: RPCHelpers */).transformInternalTextMessage(message);
|
|
value2 = null;
|
|
if (value2 != icon) {
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
value = value.getRemoteIconURL(icon);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value2;
|
|
}
|
|
object2.icon_url = r6;
|
|
object2.title = title;
|
|
object2.body = body;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [NOTIFICATION_CREATE, {}, object2]);
|
|
}
|
|
}
|
|
|
|
function handleActivityJoin({applicationId, parentApplicationId, secret, intent, embedded}) { // fn#99312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:3035, owner: RPCServerManager.handleActivityJoin, offset: 0x021c3fbe, size: 172 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var object2;
|
|
var binding;
|
|
var dispatchToSubscriptions;
|
|
const env0_0 = applicationId;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
object2 = {application_id: applicationId, secret: secret};
|
|
if (embedded) {
|
|
object2.intent = intent;
|
|
}
|
|
binding = env0_0;
|
|
rpcServer = binding.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.ACTIVITY_JOIN, _fun99313, object2]);
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.GAME_JOIN, function(a0) {
|
|
return a0.socket.application.id === applicationId;
|
|
}, object2);
|
|
}
|
|
}
|
|
|
|
function handleActivityLayoutModeUpdate({applicationId, layoutMode}) { // fn#99315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:3462, owner: RPCServerManager.handleActivityLayoutModeUpdate, offset: 0x021c40d6, size: 192 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var value2;
|
|
var FOCUSED;
|
|
var binding;
|
|
var object2;
|
|
let rpcServer = applicationId.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
FOCUSED = ActivityLayoutMode.FOCUSED;
|
|
binding = applicationId;
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.ACTIVITY_PIP_MODE_UPDATE, function(a0) {
|
|
return a0.socket.application.id === applicationId;
|
|
}, {is_pip_mode: layoutMode !== FOCUSED});
|
|
object2 = {layout_mode: layoutMode};
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.ACTIVITY_LAYOUT_MODE_UPDATE, _fun99317, object2);
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.FRAME_LAYOUT_MODE_UPDATE, _fun99318, object2);
|
|
}
|
|
}
|
|
|
|
function handleFrameUpdateLayoutMode({applicationId, layoutMode}) { // fn#99319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:3941, owner: RPCServerManager.handleFrameUpdateLayoutMode, offset: 0x021c4196, size: 228 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var r3;
|
|
var value2;
|
|
var FOCUSED;
|
|
var binding;
|
|
var object2;
|
|
let rpcServer = applicationId.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
r3 = layoutMode === FrameLayoutModes.PIP ? ActivityLayoutMode.PIP : ActivityLayoutMode.FOCUSED;
|
|
FOCUSED = ActivityLayoutMode.FOCUSED;
|
|
binding = applicationId;
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.ACTIVITY_PIP_MODE_UPDATE, function(a0) {
|
|
return a0.socket.application.id === applicationId;
|
|
}, {is_pip_mode: r3 !== FOCUSED});
|
|
object2 = {layout_mode: r3};
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.ACTIVITY_LAYOUT_MODE_UPDATE, _fun99321, object2);
|
|
rpcServer = binding.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.FRAME_LAYOUT_MODE_UPDATE, _fun99322, object2);
|
|
}
|
|
}
|
|
|
|
function handleThermalStateChange({applicationId}) { // fn#99323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:4445, owner: RPCServerManager.handleThermalStateChange, offset: 0x021c427a, size: 136 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var object2;
|
|
var value2;
|
|
const env0_0 = applicationId;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
if (applicationId != null) {
|
|
object2 = {};
|
|
value2 = environment.__proto__.__proto__;
|
|
object2.thermal_state = (require(8095) /* metro dependency 8095: useThermalState */).getThermalState();
|
|
rpcServer = env0_0.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.THERMAL_STATE_UPDATE, function(a0) {
|
|
return a0.socket.application.id === applicationId;
|
|
}, object2);
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleScreenOrientationUpdate({screenOrientation}) { // fn#99325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:4705, owner: RPCServerManager.handleScreenOrientationUpdate, offset: 0x021c4302, size: 88 bytes, params: 2, frame: 15
|
|
var dispatchToSubscriptions;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.ORIENTATION_UPDATE, {},
|
|
{screen_orientation: screenOrientation}]);
|
|
}
|
|
}
|
|
|
|
function handleEmbeddedActivityUpdate() { // fn#99326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:4894, owner: RPCServerManager.handleEmbeddedActivityUpdate, offset: 0x021c435a, size: 104 bytes, params: 1, frame: 15
|
|
var value2;
|
|
var value3;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
value3 = (require(13014) /* metro dependency 13014: activityInstanceConnectedParticipants */).activityInstanceConnectedParticipants();
|
|
rpcServer = env0_0.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE, {}, value3);
|
|
}
|
|
}
|
|
|
|
function handleActivityMessage({channelId, message}) { // fn#99327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:5113, owner: RPCServerManager.handleActivityMessage, offset: 0x021c43c2, size: 541 bytes, params: 2, frame: 26
|
|
var environment;
|
|
var r9;
|
|
var application;
|
|
var activity;
|
|
var value3;
|
|
var value4;
|
|
var currentUser;
|
|
var type;
|
|
var dispatchToSubscriptions;
|
|
var ACTIVITY_JOIN_REQUEST;
|
|
var object2;
|
|
var ACTIVITY_INVITE;
|
|
let env0_0 = undefined;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
application = message.application;
|
|
activity = message.activity;
|
|
if (application != null) {
|
|
if (activity != null) {
|
|
if (activity.party_id != null) {
|
|
value3 = environment.__proto__.__proto__;
|
|
value4 = UserStore.getUser(message.author?.id);
|
|
if (value4 != null) {
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (currentUser != null) {
|
|
if (value4.id !== currentUser.id) {
|
|
type = activity.type;
|
|
r9 = type === ActivityActionTypes.JOIN_REQUEST ? PresenceStore.getApplicationActivity(currentUser.id,
|
|
|
|
|
|
|
|
|
|
application.id) : PresenceStore.getApplicationActivity(value4.id, application.id);
|
|
if (r9 != null) {
|
|
if (r9.party != null) {
|
|
if (r9.party.id === activity.party_id) {
|
|
env0_0 = r9.application_id;
|
|
type = activity.type;
|
|
if (ActivityActionTypes.JOIN === type) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
ACTIVITY_INVITE = RPCEvents.ACTIVITY_INVITE;
|
|
object2 = {};
|
|
object2.user = (importDefault(8082) /* metro dependency 8082: transformUser */)(value4);
|
|
object2.activity = r9;
|
|
object2.type = activity.type;
|
|
object2.channel_id = channelId;
|
|
object2.message_id = message.id;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [ACTIVITY_INVITE,
|
|
function(a0) {
|
|
return a0.socket.application.id === application_id;
|
|
}, object2]);
|
|
} else if (ActivityActionTypes.JOIN_REQUEST === type) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
ACTIVITY_JOIN_REQUEST = RPCEvents.ACTIVITY_JOIN_REQUEST;
|
|
object2 = {};
|
|
object2.user = (importDefault(8082) /* metro dependency 8082: transformUser */)(value4);
|
|
object2.activity = r9;
|
|
object2.type = activity.type;
|
|
object2.channel_id = channelId;
|
|
object2.message_id = message.id;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer,
|
|
[ACTIVITY_JOIN_REQUEST,
|
|
_fun99329,
|
|
object2]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleOAuth2TokenRevoke({accessToken}) { // fn#99330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:5969, owner: RPCServerManager.handleOAuth2TokenRevoke, offset: 0x021c45df, size: 55 bytes, params: 2, frame: 11
|
|
accessToken.rpcServer.sockets.forEach(_fun99331);
|
|
}
|
|
|
|
function RPCServerManagerHandleGuildCreate({guild}) { // fn#99332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6126, owner: RPCServerManager.handleGuildCreate, offset: 0x021c4653, size: 127 bytes, params: 2, frame: 16
|
|
const id = guild.id;
|
|
const guild2 = GuildStore.getGuild(id);
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0 && guild2 != null) {
|
|
rpcServer = env0_0.rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.GUILD_CREATE, {}, {id: id, name: guild2.name});
|
|
}
|
|
}
|
|
|
|
function RPCServerManagerHandleChannelCreate({channel}) { // fn#99333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6318, owner: RPCServerManager.handleChannelCreate, offset: 0x021c46d2, size: 109 bytes, params: 2, frame: 17
|
|
var dispatchToSubscriptions;
|
|
const id = channel.id;
|
|
const name = channel.name;
|
|
const type = channel.type;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.CHANNEL_CREATE, {}, {id: id, name: name,
|
|
type: type}]);
|
|
}
|
|
}
|
|
|
|
function RPCServerManagerHandleLogout() { // fn#99334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6494, owner: RPCServerManager.handleLogout, offset: 0x021c473f, size: 42 bytes, params: 1, frame: 11
|
|
env0_0.rpcServer.sockets.forEach(function(a0) {
|
|
return a0.close(RPCCloseCodes.CLOSE_NORMAL, 'User logout');
|
|
});
|
|
}
|
|
|
|
function RPCServerManagerHandleRelationshipAdd({relationship}) { // fn#99336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6602, owner: RPCServerManager.handleRelationshipAdd, offset: 0x021c478d, size: 161 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var value2;
|
|
var user;
|
|
const id = relationship.id;
|
|
const type = relationship.type;
|
|
let rpcServer = undefined.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
user = UserStore.getUser(id);
|
|
if (user != null) {
|
|
rpcServer = (require(8081) /* metro dependency 8081: RPCHelpers */).transformBaseRelationship(type,
|
|
user).rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.RELATIONSHIP_UPDATE, {}, _fun99337);
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleRelationshipUpdate({relationship}) { // fn#99338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6930, owner: RPCServerManager.handleRelationshipUpdate, offset: 0x021c486f, size: 161 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var value2;
|
|
var user;
|
|
const id = relationship.id;
|
|
const type = relationship.type;
|
|
let rpcServer = undefined.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
user = UserStore.getUser(id);
|
|
if (user != null) {
|
|
rpcServer = (require(8081) /* metro dependency 8081: RPCHelpers */).transformBaseRelationship(type,
|
|
user).rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.RELATIONSHIP_UPDATE, {}, _fun99339);
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleRelationshipRemove({relationship}) { // fn#99340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:7258, owner: RPCServerManager.handleRelationshipRemove, offset: 0x021c4910, size: 166 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var value2;
|
|
var user;
|
|
var moduleValue;
|
|
const id = relationship.id;
|
|
let rpcServer = undefined.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
user = UserStore.getUser(id);
|
|
if (user != null) {
|
|
moduleValue = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
rpcServer = moduleValue.transformBaseRelationship(RelationshipTypes.NONE, user).rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.RELATIONSHIP_UPDATE, {}, _fun99341);
|
|
}
|
|
}
|
|
}
|
|
|
|
function RPCServerManagerHandlePresenceUpdates({updates}) { // fn#99342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:7581, owner: RPCServerManager.handlePresenceUpdates, offset: 0x021c49b6, size: 162 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var r2;
|
|
var closure;
|
|
var _createForOfIteratorHelperLoose_99303Binding;
|
|
var Set;
|
|
var map;
|
|
var prototype;
|
|
var value2;
|
|
var set;
|
|
var values;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var value5;
|
|
let env0_0 = undefined;
|
|
let value = environment;
|
|
reducibleJoin3: while (true) {
|
|
if (env0_0.rpcServer.subscriptions.length === 0) {
|
|
break reducibleJoin3;
|
|
}
|
|
closure = handlePresenceUpdates_loop;
|
|
value = environment.__proto__.__proto__;
|
|
_createForOfIteratorHelperLoose_99303Binding = _createForOfIteratorHelperLoose_99303;
|
|
Set = global.Set;
|
|
map = updates.map;
|
|
value = Reflect.apply(map, updates, [function(a0) {
|
|
return a0.user.id;
|
|
}]);
|
|
prototype = Set.prototype;
|
|
value2 = Object.create(prototype, {constructor: {value: Set}});
|
|
set = new Set(value);
|
|
value = set instanceof Object ? set : value2;
|
|
values = value.values;
|
|
value = _createForOfIteratorHelperLoose_99303Binding(Reflect.apply(values, value, []));
|
|
value3 = value();
|
|
done = value3.done;
|
|
if (done) {
|
|
break reducibleJoin3;
|
|
}
|
|
r2 = value3;
|
|
reducibleLoop2: while (true) {
|
|
value4 = r2.value;
|
|
env0_0 = value4;
|
|
closure();
|
|
value5 = value();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleJoin3;
|
|
}
|
|
r2 = value5;
|
|
continue reducibleLoop2;
|
|
}
|
|
}
|
|
}
|
|
|
|
function handlePresencesReplace() { // fn#99346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:8092, owner: RPCServerManager.handlePresencesReplace, offset: 0x021c4b38, size: 149 bytes, params: 1, frame: 20
|
|
var environment;
|
|
var r1;
|
|
var closure;
|
|
var _createForOfIteratorHelperLoose_99303Binding;
|
|
var getMutableRelationships;
|
|
var value2;
|
|
var entries;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var done;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
reducibleJoin3: while (true) {
|
|
if (env0_0.rpcServer.subscriptions.length === 0) {
|
|
break reducibleJoin3;
|
|
}
|
|
closure = handlePresencesReplace_loop2;
|
|
value = environment.__proto__.__proto__;
|
|
_createForOfIteratorHelperLoose_99303Binding = _createForOfIteratorHelperLoose_99303;
|
|
getMutableRelationships = RelationshipStore.getMutableRelationships;
|
|
value2 = Reflect.apply(getMutableRelationships, RelationshipStore, []);
|
|
entries = value2.entries;
|
|
value3 = Reflect.apply(entries, value2, []);
|
|
value4 = _createForOfIteratorHelperLoose_99303Binding(value3);
|
|
value5 = value4();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleJoin3;
|
|
}
|
|
r1 = value5;
|
|
reducibleLoop2: while (true) {
|
|
value6 = r1.value;
|
|
value7 = env2_3(value6, 2);
|
|
var env0_0 = value7[0];
|
|
var env0_1 = value7[1];
|
|
closure();
|
|
value8 = value4();
|
|
done = value8.done;
|
|
if (done) {
|
|
break reducibleJoin3;
|
|
}
|
|
r1 = value8;
|
|
continue reducibleLoop2;
|
|
}
|
|
}
|
|
}
|
|
|
|
function RPCServerManagerHandleUserUpdate({user}) { // fn#99349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:8574, owner: RPCServerManager.handleUserUpdate, offset: 0x021c4c61, size: 187 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var value2;
|
|
var relationshipType;
|
|
var user2;
|
|
const id = user.id;
|
|
let rpcServer = undefined.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
value2 = environment.__proto__.__proto__;
|
|
relationshipType = RelationshipStore.getRelationshipType(id);
|
|
if (relationshipType !== RelationshipTypes.NONE) {
|
|
user2 = UserStore.getUser(id);
|
|
if (user2 != null) {
|
|
rpcServer = (require(8081) /* metro dependency 8081: RPCHelpers */).transformBaseRelationship(relationshipType,
|
|
|
|
|
|
user2).rpcServer;
|
|
rpcServer.dispatchToSubscriptions(RPCEvents.RELATIONSHIP_UPDATE, {}, _fun99350);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function handleEntitlementCreate({entitlement}) { // fn#99351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:8933, owner: RPCServerManager.handleEntitlementCreate, offset: 0x021c4d1c, size: 99 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var dispatchToSubscriptions;
|
|
const env0_0 = entitlement;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.ENTITLEMENT_CREATE, function(a0) {
|
|
return a0.socket.application.id === entitlement.application_id;
|
|
}, {entitlement: entitlement}]);
|
|
}
|
|
}
|
|
|
|
function handleEntitlementDelete({entitlement}) { // fn#99353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:9149, owner: RPCServerManager.handleEntitlementDelete, offset: 0x021c4da5, size: 99 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var dispatchToSubscriptions;
|
|
const env0_0 = entitlement;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
value = environment.__proto__.__proto__;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RPCEvents.ENTITLEMENT_DELETE, function(a0) {
|
|
return a0.socket.application.id === entitlement.application_id;
|
|
}, {entitlement: entitlement}]);
|
|
}
|
|
}
|
|
|
|
function handleQuestEnrollSuccess({enrolledQuestUserStatus}) { // fn#99355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:9366, owner: RPCServerManager.handleQuestEnrollSuccess, offset: 0x021c4e08, size: 202 bytes, params: 2, frame: 21
|
|
var environment;
|
|
var questId;
|
|
var value2;
|
|
var quest;
|
|
var dispatchToSubscriptions;
|
|
var QUEST_ENROLLMENT_STATUS_UPDATE;
|
|
var object2;
|
|
var enrolledAt;
|
|
let env0_0 = undefined;
|
|
let rpcServer = env0_0.rpcServer;
|
|
if (rpcServer.subscriptions.length !== 0) {
|
|
questId = enrolledQuestUserStatus.questId;
|
|
env0_0 = questId;
|
|
value2 = environment.__proto__.__proto__;
|
|
quest = QuestStore.getQuest(questId);
|
|
if (quest != null) {
|
|
if ((require(7116) /* metro dependency 7116: QuestTaskUtils */).getActivityApplicationId(quest) != null) {
|
|
rpcServer = env0_0.rpcServer;
|
|
dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
QUEST_ENROLLMENT_STATUS_UPDATE = RPCEvents.QUEST_ENROLLMENT_STATUS_UPDATE;
|
|
object2 = {quest_id: questId};
|
|
enrolledAt = enrolledQuestUserStatus.enrolledAt;
|
|
object2.is_enrolled = enrolledAt != null;
|
|
enrolledAt = enrolledQuestUserStatus.enrolledAt;
|
|
object2.enrolled_at = enrolledAt;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [QUEST_ENROLLMENT_STATUS_UPDATE, _fun99356, object2]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_99358OnConnect(a0) { // fn#99360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:10651, owner: value_99358.onConnect, offset: 0x021c5446, size: 130 bytes, params: 2, frame: 18
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RPC_APP_CONNECTED', socketId: a0.id,
|
|
application: a0.application});
|
|
const defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport2.track;
|
|
const AUTHORIZED_APP_CONNECTED = AnalyticEvents.AUTHORIZED_APP_CONNECTED;
|
|
Reflect.apply(track, defaultImport2, [AUTHORIZED_APP_CONNECTED, {app_id: a0.application.id,
|
|
transport: a0.transport}]);
|
|
}
|
|
|
|
function value_99358OnDisconnect({id, application}, a1) { // fn#99361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:10861, owner: value_99358.onDisconnect, offset: 0x021c54c8, size: 77 bytes, params: 3, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RPC_APP_DISCONNECTED', socketId: id,
|
|
application: application, reason: a1});
|
|
}
|
|
|
|
function _fun99362() { // fn#99362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:11047, offset: 0x021c5515, size: 27 bytes, params: 1, frame: 9
|
|
return env0_0.rpcServer.updateSubscriptions();
|
|
}
|
|
|
|
function _fun99313(a0) { // fn#99313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:3258, offset: 0x021c406a, size: 76 bytes, params: 2, frame: 5
|
|
return a0.socket.application.id === applicationId || parentApplicationId != null && a0.socket.application.parentId === parentApplicationId;
|
|
}
|
|
|
|
function _fun99331(a0) { // fn#99331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6021, offset: 0x021c4616, size: 61 bytes, params: 2, frame: 13
|
|
var close;
|
|
if (a0.authorization.accessToken === accessToken) {
|
|
close = a0.close;
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
Reflect.apply(close, a0, [RPCCloseCodes.TOKEN_REVOKED, 'Token revoked']);
|
|
}
|
|
}
|
|
|
|
function _fun99337({socket}) { // fn#99337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:6822, offset: 0x021c482e, size: 65 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
return value.transformApplicationRelationship(env0_0, socket.application.id);
|
|
}
|
|
|
|
function handlePresenceUpdates_loop() { // fn#99343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:7656, owner: RPCServerManager.handlePresenceUpdates._loop, offset: 0x021c4a58, size: 159 bytes, params: 1, frame: 17
|
|
const relationshipType = RelationshipStore.getRelationshipType(value);
|
|
const NONE = RelationshipTypes.NONE;
|
|
if (relationshipType === NONE) {
|
|
return 0;
|
|
}
|
|
const user = UserStore.getUser(value);
|
|
if (user == null) {
|
|
return 0;
|
|
}
|
|
const env0_0 = (require(8081) /* metro dependency 8081: RPCHelpers */).transformBaseRelationship(relationshipType,
|
|
user);
|
|
const rpcServer = env1_1.rpcServer;
|
|
const dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
const RELATIONSHIP_UPDATE = RPCEvents.RELATIONSHIP_UPDATE;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RELATIONSHIP_UPDATE, {}, _fun99344]);
|
|
}
|
|
|
|
function handlePresencesReplace_loop2() { // fn#99347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:8157, owner: RPCServerManager.handlePresencesReplace._loop2, offset: 0x021c4bcd, size: 148 bytes, params: 1, frame: 17
|
|
const binding = env0_1;
|
|
const NONE = RelationshipTypes.NONE;
|
|
if (binding === NONE) {
|
|
return 0;
|
|
}
|
|
const user = UserStore.getUser(env0_0);
|
|
if (user == null) {
|
|
return 0;
|
|
}
|
|
var env0_0 = (require(8081) /* metro dependency 8081: RPCHelpers */).transformBaseRelationship(env0_1, user);
|
|
const rpcServer = env1_1.rpcServer;
|
|
const dispatchToSubscriptions = rpcServer.dispatchToSubscriptions;
|
|
const RELATIONSHIP_UPDATE = RPCEvents.RELATIONSHIP_UPDATE;
|
|
Reflect.apply(dispatchToSubscriptions, rpcServer, [RELATIONSHIP_UPDATE, {}, _fun99348]);
|
|
}
|
|
|
|
function _fun99356(a0) { // fn#99356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:9612, offset: 0x021c4ed2, size: 66 bytes, params: 2, frame: 5
|
|
return a0.socket.application.id === env0_1 && a0.args?.quest_id === questId;
|
|
}
|
|
|
|
function _fun99344({socket}) { // fn#99344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13203:7869, offset: 0x021c4af7, size: 65 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
value = require(8081) /* metro dependency 8081: RPCHelpers */;
|
|
return value.transformApplicationRelationship(env0_0, socket.application.id);
|
|
}
|
|
|