217 lines
14 KiB
TypeScript
217 lines
14 KiB
TypeScript
/* Metro module 12495; source: modules/gateway/GatewaySocketOpCodes.tsx; dependencies: [6, 7, 15, 17, 18, 4402, 12496, 21, 639, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
|
|
import RTCRegionStore from '../../stores/RTCRegionStore.tsx'; /* Metro dependency 4402 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00639Module from '../../by-id/module-00639.js'; /* Metro dependency 639 */
|
|
import * as GatewaySocketOpcodeModule from './GatewaySocketOpcode.tsx'; /* Metro dependency 12496 */
|
|
|
|
function _fun95147(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:6, offset: 0x02133530, size: 256 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const EventEmitter = (Module00639Module).EventEmitter;
|
|
const value = _fun95151(EventEmitter);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/gateway/GatewaySocketOpCodes.tsx');
|
|
exports.default = value;
|
|
const Opcode = (GatewaySocketOpcodeModule).Opcode;
|
|
exports.Opcode = Opcode;
|
|
function _isNativeReflectConstruct_95148() { // fn#95148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:158, offset: 0x02133630, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_95148_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun95151(a0) { // fn#95151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:357, offset: 0x02133692, size: 575 bytes, params: 2, frame: 16
|
|
const GatewaySocketOpCodes2 = GatewaySocketOpCodes;
|
|
Inherits(GatewaySocketOpCodes2, a0);
|
|
return CreateClass(GatewaySocketOpCodes2, [{key: 'presenceUpdate', value: function(a0, a1, a2, a3) {
|
|
var PRESENCE_UPDATE = require(dependencyMap[6]).Opcode.PRESENCE_UPDATE;
|
|
this.send(PRESENCE_UPDATE, {status: a0, since: a1, activities: a2, afk: a3});
|
|
}}, {key: 'voiceStateUpdate', value: value_95154}, {key: 'voiceServerPing', value: function() {
|
|
var VOICE_SERVER_PING = require(dependencyMap[6]).Opcode.VOICE_SERVER_PING;
|
|
this.send(VOICE_SERVER_PING, null);
|
|
}}, {key: 'requestGuildMembers', value: function(a0, {query, limit, userIds, presences}) {
|
|
var REQUEST_GUILD_MEMBERS = require(dependencyMap[6]).Opcode.REQUEST_GUILD_MEMBERS;
|
|
this.send(REQUEST_GUILD_MEMBERS, {guild_id: a0, query: query, limit: limit, user_ids: userIds,
|
|
presences: presences});
|
|
}}, {key: 'searchRecentMembers', value: value_95158}, {key: 'updateGuildSubscriptions', value: value_95159},
|
|
{key: 'callConnect', value: function(a0) {
|
|
var CALL_CONNECT = require(dependencyMap[6]).Opcode.CALL_CONNECT;
|
|
this.send(CALL_CONNECT, {channel_id: a0});
|
|
}}, {key: 'streamCreate', value: value_95162}, {key: 'streamWatch', value: function(a0) {
|
|
var STREAM_WATCH = require(dependencyMap[6]).Opcode.STREAM_WATCH;
|
|
this.send(STREAM_WATCH, {stream_key: a0});
|
|
}}, {key: 'streamPing', value: function(a0) {
|
|
var STREAM_PING = require(dependencyMap[6]).Opcode.STREAM_PING;
|
|
this.send(STREAM_PING, {stream_key: a0});
|
|
}}, {key: 'streamDelete', value: function(a0) {
|
|
var STREAM_DELETE = require(dependencyMap[6]).Opcode.STREAM_DELETE;
|
|
this.send(STREAM_DELETE, {stream_key: a0});
|
|
}}, {key: 'streamSetPaused', value: function(a0, a1) {
|
|
var STREAM_SET_PAUSED = require(dependencyMap[6]).Opcode.STREAM_SET_PAUSED;
|
|
this.send(STREAM_SET_PAUSED, {stream_key: a0, paused: a1});
|
|
}}, {key: 'requestForumUnreads', value: function(a0, a1, a2) {
|
|
var REQUEST_FORUM_UNREADS = require(dependencyMap[6]).Opcode.REQUEST_FORUM_UNREADS;
|
|
this.send(REQUEST_FORUM_UNREADS, {guild_id: a0, channel_id: a1, threads: a2.map(_fun95168)});
|
|
}}, {key: 'requestSoundboardSounds', value: function(a0) {
|
|
var REQUEST_SOUNDBOARD_SOUNDS = require(dependencyMap[6]).Opcode.REQUEST_SOUNDBOARD_SOUNDS;
|
|
this.send(REQUEST_SOUNDBOARD_SOUNDS, {guild_ids: a0});
|
|
}}, {key: 'requestLastMessages', value: function(a0, a1) {
|
|
var REQUEST_LAST_MESSAGES = require(dependencyMap[6]).Opcode.REQUEST_LAST_MESSAGES;
|
|
this.send(REQUEST_LAST_MESSAGES, {guild_id: a0, channel_ids: a1});
|
|
}}, {key: 'getDeletedEntityIdsNotMatchingHash', value: function(a0, a1, a2, a3, a4) {
|
|
var GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH = require(dependencyMap[6]).Opcode.GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH;
|
|
this.send(GET_DELETED_ENTITY_IDS_NOT_MATCHING_HASH, {guild_id: a0, channel_ids_hash: a1, role_ids_hash: a2,
|
|
emoji_ids_hash: a3, sticker_ids_hash: a4});
|
|
}}, {key: 'triggerGuildChannelResync', value: function(a0, a1) {
|
|
var GUILD_CHANNELS_RESYNC = require(dependencyMap[6]).Opcode.GUILD_CHANNELS_RESYNC;
|
|
this.send(GUILD_CHANNELS_RESYNC, {guild_id: a0, obfuscated_channel_ids: a1});
|
|
}}, {key: 'requestChannelInfo', value: function(a0, a1) {
|
|
var REQUEST_CHANNEL_INFO = require(dependencyMap[6]).Opcode.REQUEST_CHANNEL_INFO;
|
|
this.send(REQUEST_CHANNEL_INFO, {guild_id: a0, fields: a1});
|
|
}}, {key: 'requestChannelMemberCount', value: function(a0, a1) {
|
|
var REQUEST_CHANNEL_MEMBER_COUNT = require(dependencyMap[6]).Opcode.REQUEST_CHANNEL_MEMBER_COUNT;
|
|
this.send(REQUEST_CHANNEL_MEMBER_COUNT, {guild_id: a0, channel_id: a1});
|
|
}}, {key: 'remoteCommand', value: function(a0, a1) {
|
|
var REMOTE_COMMAND = require(dependencyMap[6]).Opcode.REMOTE_COMMAND;
|
|
this.send(REMOTE_COMMAND, {target_session_id: a0, payload: a1});
|
|
}}]);
|
|
function GatewaySocketOpCodes() { // fn#95152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:369, offset: 0x00c7c82b, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_3(this, GatewaySocketOpCodes);
|
|
const value3 = env1_6(GatewaySocketOpCodes);
|
|
return env1_5(this, _isNativeReflectConstruct_95148() ? global.Reflect.construct(value3, arguments,
|
|
env1_6(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_95154({guildId, channelId, selfMute, selfDeaf, selfVideo, preferredRegion, preferredRegions, videoStreamParameters, flags}) { // fn#95154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:821, offset: 0x02133928, size: 272 bytes, params: 2, frame: 21
|
|
guildId = guildId === undefined ? null : guildId;
|
|
channelId = channelId === undefined ? null : channelId;
|
|
selfMute = !(selfMute === undefined) && selfMute;
|
|
selfDeaf = !(selfDeaf === undefined) && selfDeaf;
|
|
selfVideo = !(selfVideo === undefined) && selfVideo;
|
|
preferredRegion = preferredRegion === undefined ? null : preferredRegion;
|
|
preferredRegions = preferredRegions === undefined ? null : preferredRegions;
|
|
videoStreamParameters = videoStreamParameters === undefined ? null : videoStreamParameters;
|
|
flags = flags === undefined ? 0 : flags;
|
|
const object = {guild_id: guildId, channel_id: channelId, self_mute: selfMute, self_deaf: selfDeaf,
|
|
self_video: selfVideo, flags: flags};
|
|
if (channelId != null && RTCRegionStore.shouldIncludePreferredRegion()) {
|
|
object.preferred_region = preferredRegion;
|
|
object.preferred_regions = preferredRegions;
|
|
}
|
|
if (videoStreamParameters != null) {
|
|
object.tracks = videoStreamParameters?.map(function(a0) {
|
|
return {type: a0.type, rid: a0.rid, quality: a0.quality};
|
|
});
|
|
}
|
|
const send = this.send;
|
|
const Opcode = (GatewaySocketOpcodeModule).Opcode;
|
|
const VOICE_STATE_UPDATE = Opcode.VOICE_STATE_UPDATE;
|
|
Reflect.apply(send, this, [VOICE_STATE_UPDATE, object]);
|
|
}
|
|
|
|
function value_95158(a0, {query, continuationToken}) { // fn#95158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:1610, offset: 0x02133b02, size: 118 bytes, params: 3, frame: 19
|
|
const send = this.send;
|
|
let value = environment.__proto__;
|
|
const Opcode = (GatewaySocketOpcodeModule).Opcode;
|
|
const SEARCH_RECENT_MEMBERS = Opcode.SEARCH_RECENT_MEMBERS;
|
|
value = null;
|
|
Reflect.apply(send, this, [SEARCH_RECENT_MEMBERS, {guild_id: a0, query: value != query ? query : '',
|
|
continuation_token: value != continuationToken ? continuationToken : value}]);
|
|
}
|
|
|
|
function value_95159(a0) { // fn#95159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:1806, offset: 0x02133b78, size: 145 bytes, params: 2, frame: 17
|
|
const env0_1 = a0;
|
|
const object2 = {};
|
|
const env0_3 = 0;
|
|
(SnowflakeUtils).keys(a0).forEach(_fun95160);
|
|
if (env0_3 > 0) {
|
|
this.send((require(12496) /* metro dependency 12496: GatewaySocketOpcode */).Opcode.GUILD_SUBSCRIPTIONS_BULK,
|
|
{subscriptions: object2});
|
|
}
|
|
function _fun95160(a0) { // fn#95160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:1856, offset: 0x02133c09, size: 168 bytes, params: 2, frame: 18
|
|
var object2;
|
|
var binding;
|
|
var send;
|
|
var value2;
|
|
const property = env0_1[a0];
|
|
const JSON = global.JSON;
|
|
const length = JSON.stringify([a0, property]).length;
|
|
if (env0_3 + length > 15360) {
|
|
binding = env0_0;
|
|
send = binding.send;
|
|
value2 = environment.__proto__.__proto__;
|
|
Reflect.apply(send, binding,
|
|
[(require(12496) /* metro dependency 12496: GatewaySocketOpcode */).Opcode.GUILD_SUBSCRIPTIONS_BULK,
|
|
{subscriptions: object2}]);
|
|
object2 = {};
|
|
env0_3 = 0;
|
|
}
|
|
object2[a0] = property;
|
|
env0_3 += length;
|
|
}
|
|
|
|
}
|
|
|
|
function value_95162(a0, a1, a2) { // fn#95162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:2203, offset: 0x02133cf0, size: 91 bytes, params: 4, frame: 16
|
|
let value = a3;
|
|
const r5 = value !== undefined ? value : null;
|
|
const send = this.send;
|
|
value = environment.__proto__;
|
|
const Opcode = (GatewaySocketOpcodeModule).Opcode;
|
|
const STREAM_CREATE = Opcode.STREAM_CREATE;
|
|
Reflect.apply(send, this, [STREAM_CREATE, {type: a0, guild_id: a1, channel_id: a2, preferred_region: r5}]);
|
|
}
|
|
|
|
function value_95167(a0, a1, a2) { // fn#95167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:2745, offset: 0x02133e53, size: 97 bytes, params: 4, frame: 17
|
|
const send = this.send;
|
|
const Opcode = (GatewaySocketOpcodeModule).Opcode;
|
|
const REQUEST_FORUM_UNREADS = Opcode.REQUEST_FORUM_UNREADS;
|
|
const object = {guild_id: a0, channel_id: a1};
|
|
object.threads = a2.map(function(a0) {
|
|
return {thread_id: a0.threadId, ack_message_id: a0.ackMessageId};
|
|
});
|
|
Reflect.apply(send, this, [REQUEST_FORUM_UNREADS, object]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun95168({threadId, ackMessageId}) { // fn#95168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12685:2848, offset: 0x02133eb4, size: 31 bytes, params: 2, frame: 3
|
|
return {thread_id: threadId, ack_message_id: ackMessageId};
|
|
}
|
|
|
|
global.__d(_fun95147, 12495, [6, 7, 15, 17, 18, 4402, 12496, 21, 639,
|
|
2]) /* metro module 12495, dependencies: [6, 7, 15, 17, 18, 4402, 12496, 21, 639, 2] */;
|