1960 lines
87 KiB
TypeScript
1960 lines
87 KiB
TypeScript
/* Metro module 6867; source: modules/spotify/SpotifyStore.tsx; dependencies: [15, 17, 18, 6, 7, 4266, 1226, 5040, 4795, 4396, 4607, 4297, 6868, 661, 4915, 672, 3, 4041, 694, 22, 6869, 561, 683, 628, 6872, 4612, 1360, 6873, 566, 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 Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import RunningGameStoreNative from '../game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */
|
|
import VoiceStateStore from '../../stores/VoiceStateStore.tsx'; /* Metro dependency 4297 */
|
|
import PresenceStore from '../../stores/PresenceStore.tsx'; /* Metro dependency 4396 */
|
|
import SpeakingStore from '../../stores/SpeakingStore.tsx'; /* Metro dependency 4607 */
|
|
import IdleStore from '../../stores/IdleStore.tsx'; /* Metro dependency 4795 */
|
|
import ConnectedAccountsStore from '../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
|
|
import StopSyncingUserActivity from '../activities/utils/stopSyncingUserActivity.tsx'; /* Metro dependency 6872 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as GlobalUtilsModule from '../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */
|
|
import * as SpotifyConstantsModule from './SpotifyConstants.tsx'; /* Metro dependency 6868 */
|
|
import * as SpotifyActionCreatorsModule from './SpotifyActionCreators.tsx'; /* Metro dependency 6869 */
|
|
|
|
function _fun54270(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:6, offset: 0x01360cdc, size: 1431 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_54276 = 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 findSpotifyActivity = function(a0) {
|
|
return PresenceStore.findActivity(a0, _fun54282);
|
|
};
|
|
const ACTIVITY_SYNC_STOP2 = ACTIVITY_SYNC_STOP;
|
|
const USER_CONNECTIONS_UPDATE_542882 = USER_CONNECTIONS_UPDATE_54288;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = SpotifyConstantsModule;
|
|
const env0_15 = value.getSpotifyResourceType;
|
|
const env0_16 = value.isSpotifyParty;
|
|
const env0_17 = value.SPOTIFY_PARTY_PREFIX;
|
|
const env0_18 = value.SpotifyEndpoints;
|
|
const env0_19 = value.SpotifyResourceTypes;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const PlatformTypes = value.PlatformTypes;
|
|
const env0_21 = value.ActivityFlags;
|
|
const env0_22 = value.AnalyticEvents;
|
|
value = importDefault(4915) /* metro dependency 4915: Platforms */;
|
|
const get = value.get;
|
|
const SPOTIFY = PlatformTypes.SPOTIFY;
|
|
const env0_26 = Reflect.apply(get, value, [SPOTIFY]);
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
let SECOND = Millis.SECOND;
|
|
const env0_27 = 30 * SECOND;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
SECOND = Millis.SECOND;
|
|
const env0_28 = 30 * SECOND;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
let MINUTE = Millis.MINUTE;
|
|
const env0_29 = 5 * MINUTE;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
SECOND = Millis.SECOND;
|
|
const env0_30 = 5 * SECOND;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
SECOND = Millis.SECOND;
|
|
const env0_31 = 1.5 * SECOND;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
MINUTE = Millis.MINUTE;
|
|
const env0_32 = 1 * MINUTE;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
SECOND = Millis.SECOND;
|
|
const env0_33 = 3 * SECOND;
|
|
object = {PLAYER_STATE_CHANGED: 'PLAYER_STATE_CHANGED', DEVICE_STATE_CHANGED: 'DEVICE_STATE_CHANGED'};
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('Spotify');
|
|
const Timeout = (TimersModule).Timeout;
|
|
let timeout = new Timeout();
|
|
timeout = new Timeout();
|
|
timeout = new Timeout();
|
|
timeout = new Timeout();
|
|
timeout = new Timeout();
|
|
const env0_44 = {};
|
|
const env0_45 = {};
|
|
const env0_46 = {};
|
|
const Set = global.Set;
|
|
let WebSocket = global.WebSocket;
|
|
const CONNECTING = WebSocket.CONNECTING;
|
|
WebSocket = global.WebSocket;
|
|
const OPEN = WebSocket.OPEN;
|
|
let set = new Set([CONNECTING, OPEN]);
|
|
set = _fun54303();
|
|
const Store = (Flux).Store;
|
|
let value3 = _fun54318(Store);
|
|
value3.displayName = 'SpotifyStore';
|
|
const value6 = new value3(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{USER_CONNECTIONS_UPDATE: USER_CONNECTIONS_UPDATE_542882, CONNECTION_OPEN: USER_CONNECTIONS_UPDATE_542882,
|
|
SPOTIFY_ACCOUNT_ACCESS_TOKEN: function({accountId, accessToken}) {
|
|
upsertAccount(accountId, accessToken);
|
|
return false;
|
|
}, SPOTIFY_ACCOUNT_ACCESS_TOKEN_REVOKE: function({accountId}) {
|
|
removeAccount(accountId);
|
|
}, SPOTIFY_PROFILE_UPDATE: SPOTIFY_PROFILE_UPDATE, SPOTIFY_PLAYER_STATE: SPOTIFY_PLAYER_STATE,
|
|
SPOTIFY_PLAYER_PLAY: function(a0) {
|
|
env0_25 = a0.id;
|
|
}, ACTIVITY_PLAY: ACTIVITY_PLAY, ACTIVITY_SYNC: function({activity, userId}) {
|
|
return activitySync(userId, activity, true);
|
|
}, ACTIVITY_SYNC_STOP: ACTIVITY_SYNC_STOP2, SPOTIFY_SET_DEVICES: SPOTIFY_SET_DEVICES,
|
|
SPOTIFY_SET_ACTIVE_DEVICE: function({accountId, deviceId}) {
|
|
setActiveDevice(accountId, deviceId);
|
|
}, SPEAKING: function({userId}) {
|
|
setSpeaking(userId);
|
|
return false;
|
|
}, VOICE_STATE_UPDATES: function({voiceStates}) {
|
|
return voiceStates.reduce(_fun54355, false);
|
|
}, MEDIA_ENGINE_SET_GO_LIVE_SOURCE: MEDIA_ENGINE_SET_GO_LIVE_SOURCE_54356});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/spotify/SpotifyStore.tsx');
|
|
exports.default = value6;
|
|
exports.SpotifySocket = set;
|
|
function _isNativeReflectConstruct_54271() { // fn#54271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:418, offset: 0x01361273, size: 94 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_54271_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_54274(a0, a1) { // fn#54274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:611, offset: 0x013612d1, size: 370 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 _fun54275;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_54276(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_54276(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_54276(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun54275;
|
|
}
|
|
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 _fun54275() { // fn#54275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:1182, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function _getActiveSocketAndDevice() { // fn#54277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2116, offset: 0x01361443, size: 111 bytes, params: 1, frame: 22
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var connected;
|
|
var property2;
|
|
var find;
|
|
var value2;
|
|
const properties = Object.keys(env0_44);
|
|
const properties2 = 0;
|
|
const properties3 = properties.length;
|
|
if (properties === undefined) {
|
|
return undefined;
|
|
}
|
|
let r8 = properties2;
|
|
loopExit1: while (true) {
|
|
propertyName = properties[r8];
|
|
propertyName2 = r8 + 1;
|
|
if (propertyName === undefined) {
|
|
return undefined;
|
|
}
|
|
property = env0_44[propertyName];
|
|
connected = property.connected;
|
|
if (connected) {
|
|
if (env0_45[propertyName] == null) {
|
|
r8 = propertyName2;
|
|
continue;
|
|
}
|
|
property2 = env0_45[propertyName];
|
|
find = property2.find;
|
|
value2 = Reflect.apply(find, property2, [function(a0) {
|
|
return a0.is_active;
|
|
}]);
|
|
if (value2 == null) {
|
|
r8 = propertyName2;
|
|
continue;
|
|
}
|
|
break loopExit1;
|
|
}
|
|
r8 = propertyName2;
|
|
continue;
|
|
}
|
|
return {socket: property, device: value2};
|
|
}
|
|
|
|
function calculateStartTime(a0, a1) { // fn#54279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2281, offset: 0x013614bd, size: 81 bytes, params: 3, frame: 13
|
|
const Date = global.Date;
|
|
let value = Date.now();
|
|
const startTime = a0 != null ? a0.startTime : 0;
|
|
value -= a1;
|
|
const Math = global.Math;
|
|
return Math.abs(value - startTime) > env0_31 ? value : startTime;
|
|
}
|
|
|
|
function sendStoppedPlayerState(a0) { // fn#54280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2388, offset: 0x0136150e, size: 60 bytes, params: 2, frame: 13
|
|
(Dispatcher).dispatch({'type': 'SPOTIFY_PLAYER_STATE',
|
|
'accountId': null, 'track': null, 'volumePercent': 0, 'isPlaying': false, 'repeat': false, 'position': 0,
|
|
'context': null, accountId: a0});
|
|
}
|
|
|
|
function findSpotifyActivity(a0) { // fn#54281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2558, offset: 0x0136154a, size: 31 bytes, params: 2, frame: 13
|
|
return PresenceStore.findActivity(a0, _fun54282);
|
|
function _fun54282(a0) { // fn#54282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2615, offset: 0x01361569, size: 63 bytes, params: 2, frame: 12
|
|
let value = a0.party != null;
|
|
let r0 = value && a0.party.id != null;
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = isSpotifyParty(a0.party.id);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function upsertAccount(a0, a1) { // fn#54283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:5313, offset: 0x013615a8, size: 152 bytes, params: 3, frame: 17
|
|
var binding2;
|
|
var value3;
|
|
var binding22;
|
|
const value2 = a0 in env0_44;
|
|
let binding = env0_44;
|
|
if (value2) {
|
|
binding[a0].accessToken = a1;
|
|
binding = env0_38;
|
|
binding.info('Updated account access token: ' + a0);
|
|
} else {
|
|
binding2 = env0_50;
|
|
value3 = Object.create(binding2.prototype, {constructor: {value: binding2}});
|
|
binding22 = new binding2(a0, a1);
|
|
binding[a0] = binding22 instanceof Object ? binding22 : value3;
|
|
binding = env0_38;
|
|
binding.info('Added account: ' + a0);
|
|
}
|
|
}
|
|
|
|
function removeAccount(a0) { // fn#54284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:5463, offset: 0x01361640, size: 160 bytes, params: 2, frame: 14
|
|
var r2;
|
|
var property;
|
|
var track;
|
|
var id;
|
|
if (a0 in env0_44) {
|
|
property = env0_44[a0];
|
|
property.disconnect();
|
|
delete env0_44[a0];
|
|
property = env0_46[a0];
|
|
r2 = property != null && env0_23 != null;
|
|
if (r2) {
|
|
track = property.track;
|
|
id = track.id;
|
|
track = env0_23.track;
|
|
r2 = id === track.id;
|
|
}
|
|
if (r2) {
|
|
}
|
|
delete env0_46[a0];
|
|
env0_38.info('Removed account: ' + a0);
|
|
}
|
|
}
|
|
|
|
function setActiveDevice(a0, a1) { // fn#54285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:5638, offset: 0x013616e0, size: 77 bytes, params: 3, frame: 14
|
|
var r2;
|
|
var value3;
|
|
var id;
|
|
var value4;
|
|
const value = _createForOfIteratorHelperLoose_54274(env0_45[a0]);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (!done) {
|
|
for (r2 = value2; true; r2 = value4) {
|
|
value3 = r2.value;
|
|
id = value3.id;
|
|
value3.is_active = id === a1;
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function activitySync(a0, a1, a2) { // fn#54286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:5770, offset: 0x0136172d, size: 543 bytes, params: 4, frame: 33
|
|
var r6;
|
|
var r15;
|
|
var type;
|
|
var r11;
|
|
var Date;
|
|
var Math;
|
|
var max;
|
|
var value7;
|
|
var binding;
|
|
var accountId;
|
|
var property;
|
|
var getSpotifyResourceTypeBinding;
|
|
var metadata;
|
|
var spotifyResourceTypeBinding;
|
|
var moduleValue;
|
|
var play;
|
|
var accessToken;
|
|
var object;
|
|
var defaultImport;
|
|
var info;
|
|
const _getActiveSocketAndDeviceBinding = _getActiveSocketAndDevice;
|
|
const value2 = undefined;
|
|
const value3 = _getActiveSocketAndDeviceBinding();
|
|
const value4 = null;
|
|
if (value4 != value3) {
|
|
var socket = value3.socket;
|
|
var device = value3.device;
|
|
var sync_id = a1.sync_id;
|
|
var party = a1.party;
|
|
var timestamps = a1.timestamps;
|
|
if (value4 == sync_id) {
|
|
return false;
|
|
}
|
|
if (value4 == party) {
|
|
return false;
|
|
}
|
|
var id = party.id;
|
|
if (value4 == id) {
|
|
return false;
|
|
}
|
|
var isSpotifyPartyBinding = isSpotifyParty;
|
|
id = party.id;
|
|
if (isSpotifyPartyBinding(id)) {
|
|
r6 = value4 == timestamps ? global.Date.now() : value4 != timestamps.start ? timestamps.start : global.Date.now();
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
Date = global.Date;
|
|
value7 = Reflect.apply(max, Math, [0, Date.now() - r6]);
|
|
binding = env0_46;
|
|
accountId = socket.accountId;
|
|
property = binding[accountId];
|
|
r15 = value4 != property && property.repeat === false && value4;
|
|
getSpotifyResourceTypeBinding = getSpotifyResourceType;
|
|
metadata = a1.metadata;
|
|
type = value4 == metadata ? value2 : metadata.type;
|
|
spotifyResourceTypeBinding = getSpotifyResourceTypeBinding(value4 != type ? type : SpotifyResourceTypes.TRACK);
|
|
if (value4 != spotifyResourceTypeBinding) {
|
|
moduleValue = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
play = moduleValue.play;
|
|
accountId = socket.accountId;
|
|
accessToken = socket.accessToken;
|
|
object = {position: Number(value7)};
|
|
id = device.id;
|
|
object.deviceId = id;
|
|
object.repeat = r15;
|
|
Reflect.apply(play, moduleValue, [accountId, accessToken, sync_id, spotifyResourceTypeBinding, object]);
|
|
object = {userId: a0};
|
|
id = party.id;
|
|
object.partyId = id;
|
|
object.trackId = sync_id;
|
|
object.startTime = r6;
|
|
if (a2) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.SPOTIFY_LISTEN_ALONG_STARTED, {party_id: party.id,
|
|
other_user_id: a0});
|
|
r11 = 'started';
|
|
} else {
|
|
r11 = 'presence change';
|
|
}
|
|
binding = env0_38;
|
|
info = binding.info;
|
|
accountId = socket.accountId;
|
|
Reflect.apply(info, binding,
|
|
['Listen along ' + r11 + ': ' + accountId + ' to ' + a0 + ' playing ' + sync_id + ' on ' + device.name]);
|
|
}
|
|
return value2;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function ACTIVITY_SYNC_STOP() { // fn#54287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:6507, offset: 0x0136194c, size: 255 bytes, params: 1, frame: 18
|
|
var socket;
|
|
var property;
|
|
var value;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const SPOTIFY_LISTEN_ALONG_ENDED = AnalyticEvents.SPOTIFY_LISTEN_ALONG_ENDED;
|
|
const value2 = null;
|
|
const userId = value2 != env0_24 ? env0_24.userId : value2;
|
|
Reflect.apply(track, defaultImport, [SPOTIFY_LISTEN_ALONG_ENDED,
|
|
{party_id: value2 != env0_24 ? env0_24.partyId : value2, other_user_id: userId}]);
|
|
const trackId = value2 != env0_24 ? env0_24.trackId : value2;
|
|
env0_38.info('Listen along stopped');
|
|
const value3 = _getActiveSocketAndDevice();
|
|
if (value2 != value3) {
|
|
socket = value3.socket;
|
|
property = env0_46[socket.accountId];
|
|
if (value2 != property && property.track.id === trackId) {
|
|
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
value.pause(socket.accountId, socket.accessToken);
|
|
}
|
|
}
|
|
}
|
|
|
|
function CONNECTION_OPEN_54288() { // fn#54288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:6874, offset: 0x01361a4b, size: 340 bytes, params: 1, frame: 24
|
|
var r2;
|
|
var r3;
|
|
var r11;
|
|
var r0;
|
|
var property;
|
|
var includes;
|
|
var value7;
|
|
var value11;
|
|
var value12;
|
|
var account;
|
|
var id;
|
|
var id2;
|
|
var value13;
|
|
var value14;
|
|
var accessToken;
|
|
var upsertAccountBinding;
|
|
var moduleValue;
|
|
var getAccessToken;
|
|
var value15;
|
|
const Object = global.Object;
|
|
const value2 = Object.keys(env0_44);
|
|
const value4 = ConnectedAccountsStore.getAccounts().filter(function({type}) {
|
|
return type === PlatformTypes.SPOTIFY;
|
|
});
|
|
if (value4 == null) {
|
|
return false;
|
|
}
|
|
const value5 = value4.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
let length = value2.length;
|
|
const value6 = 0;
|
|
if (value6 < length) {
|
|
r2 = value6;
|
|
while (true) {
|
|
property = value2[r2];
|
|
includes = value5.includes;
|
|
if (!Reflect.apply(includes, value5, [property])) {
|
|
removeAccount(property);
|
|
}
|
|
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value2.length;
|
|
if (value7 < length) {
|
|
r2 = value7;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
const value8 = _createForOfIteratorHelperLoose_54274(value4);
|
|
const value9 = value8();
|
|
let done = value9.done;
|
|
const value10 = false;
|
|
if (done) {
|
|
r0 = value10;
|
|
} else {
|
|
r2 = value10;
|
|
r3 = value9;
|
|
while (true) {
|
|
value11 = r3.value;
|
|
value12 = env0_23 != null;
|
|
if (value12) {
|
|
account = env0_23.account;
|
|
id = account.id;
|
|
id2 = value11.id;
|
|
value13 = id === id2;
|
|
r11 = value13;
|
|
} else {
|
|
r11 = value12;
|
|
}
|
|
if (!r11) {
|
|
continue;
|
|
}
|
|
env0_23.account = value11;
|
|
value14 = true;
|
|
r2 = value14;
|
|
includes = value2.includes;
|
|
id = value11.id;
|
|
if (Reflect.apply(includes, value2, [id])) {
|
|
continue;
|
|
}
|
|
accessToken = value11.accessToken;
|
|
if (accessToken == null) {
|
|
moduleValue = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
getAccessToken = moduleValue.getAccessToken;
|
|
id = value11.id;
|
|
Reflect.apply(getAccessToken, moduleValue, [id]);
|
|
} else {
|
|
upsertAccountBinding = upsertAccount;
|
|
id = value11.id;
|
|
accessToken = value11.accessToken;
|
|
upsertAccountBinding(id, accessToken);
|
|
}
|
|
value15 = value8();
|
|
done = value15.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value15;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function autoPause() { // fn#54291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:7351, offset: 0x01361bba, size: 147 bytes, params: 1, frame: 16
|
|
var value2;
|
|
var socket;
|
|
var moduleValue;
|
|
var defaultImport;
|
|
if (env0_23 != null) {
|
|
value2 = _getActiveSocketAndDevice();
|
|
if (value2 != null) {
|
|
socket = value2.socket;
|
|
moduleValue = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
moduleValue.pause(socket.accountId, socket.accessToken);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.SPOTIFY_AUTO_PAUSED);
|
|
env0_38.info('Playback auto paused');
|
|
}
|
|
}
|
|
}
|
|
|
|
function setSpeaking(a0) { // fn#54292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:7564, offset: 0x01361c4d, size: 178 bytes, params: 2, frame: 16
|
|
var isCurrentClientInVoiceChannel2;
|
|
var moduleValue;
|
|
var getIsSpeaking;
|
|
var object;
|
|
var binding;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
if (a0 === Reflect.apply(getId, authenticationStoreBinding, [])) {
|
|
isCurrentClientInVoiceChannel2 = VoiceStateStore.isCurrentClientInVoiceChannel();
|
|
moduleValue = require(4612) /* metro dependency 4612: useIsSpeaking */;
|
|
getIsSpeaking = moduleValue.getIsSpeaking;
|
|
object = {'userId': null, 'checkSoundSharing': true, 'checkSoundboardSounds': false};
|
|
object.userId = a0;
|
|
if (isCurrentClientInVoiceChannel2) {
|
|
if (Reflect.apply(getIsSpeaking, moduleValue, [object])) {
|
|
if (env0_23 != null) {
|
|
binding = env0_39;
|
|
binding.start(env0_28, autoPause, false);
|
|
binding = env0_40;
|
|
binding.stop();
|
|
} else {
|
|
env0_40.start(100, _fun54293, false);
|
|
}
|
|
} else {
|
|
env0_40.start(100, _fun54293, false);
|
|
}
|
|
} else {
|
|
env0_40.start(100, _fun54293, false);
|
|
}
|
|
}
|
|
return false;
|
|
function _fun54293() { // fn#54293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:7792, offset: 0x01361cff, size: 19 bytes, params: 1, frame: 9
|
|
return env1_39.stop();
|
|
}
|
|
|
|
}
|
|
|
|
function updatePlayerState(a0, a1, {device, progress_ms, is_playing, repeat_state, item, context}) { // fn#54294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:7819, offset: 0x01361d12, size: 1026 bytes, params: 4, frame: 25
|
|
var id;
|
|
var name;
|
|
var r9;
|
|
var r1;
|
|
var is_local;
|
|
var r2;
|
|
var object;
|
|
var object2;
|
|
var show;
|
|
var value4;
|
|
var album;
|
|
var object3;
|
|
var value7;
|
|
var Array;
|
|
var Promise;
|
|
var playerState;
|
|
const SpotifyAPI = (SpotifyActionCreatorsModule).SpotifyAPI;
|
|
const env0_0 = a0;
|
|
let value = undefined;
|
|
if (item == null) {
|
|
if (item != null) {
|
|
if (item.type === SpotifyResourceTypes.EPISODE) {
|
|
id = item.id;
|
|
object = {id: id};
|
|
name = item.name;
|
|
object.name = name;
|
|
object.duration = item.duration_ms;
|
|
object.type = SpotifyResourceTypes.EPISODE;
|
|
object2 = {};
|
|
show = item.show;
|
|
id = show == null ? value : show.id;
|
|
value4 = '';
|
|
object2.id = id ?? value4;
|
|
show = item.show;
|
|
name = show == null ? value : show.name;
|
|
r9 = name ?? value4;
|
|
object2.name = r9;
|
|
show = item.show;
|
|
r9 = show == null ? value : show.images[0];
|
|
object2.image = r9;
|
|
album = item.album;
|
|
r9 = (album == null ? value : album.type) ?? SpotifyResourceTypes.SHOW;
|
|
object2.type = r9;
|
|
object.album = object2;
|
|
object.artists = [];
|
|
object.isLocal = false;
|
|
}
|
|
}
|
|
} else if (item.type === SpotifyResourceTypes.TRACK) {
|
|
id = item.id;
|
|
id = item.linked_from != null && item.linked_from.id != null ? item.linked_from.id : id;
|
|
object = {id: id};
|
|
name = item.name;
|
|
object.name = name;
|
|
object.duration = item.duration_ms;
|
|
object.type = SpotifyResourceTypes.TRACK;
|
|
object3 = {};
|
|
album = item.album;
|
|
id = album == null ? value : album.id;
|
|
value7 = '';
|
|
object3.id = id ?? value7;
|
|
album = item.album;
|
|
name = album == null ? value : album.name;
|
|
r9 = name ?? value7;
|
|
object3.name = r9;
|
|
album = item.album;
|
|
r9 = album == null ? value : album.images[0];
|
|
object3.image = r9;
|
|
album = item.album;
|
|
r9 = (album == null ? value : album.type) ?? SpotifyResourceTypes.ALBUM;
|
|
object3.type = r9;
|
|
object.album = object3;
|
|
Array = global.Array;
|
|
object.artists = Array.isArray(item.artists) ? item.artists.filter(_fun54295) : [];
|
|
is_local = item.is_local;
|
|
is_local = !!is_local && is_local;
|
|
object.isLocal = is_local;
|
|
} else if (item != null) {
|
|
if (item.type === SpotifyResourceTypes.EPISODE) {
|
|
id = item.id;
|
|
object = {id: id};
|
|
name = item.name;
|
|
object.name = name;
|
|
object.duration = item.duration_ms;
|
|
object.type = SpotifyResourceTypes.EPISODE;
|
|
object2 = {};
|
|
show = item.show;
|
|
id = show == null ? value : show.id;
|
|
value4 = '';
|
|
object2.id = id ?? value4;
|
|
show = item.show;
|
|
name = show == null ? value : show.name;
|
|
r9 = name ?? value4;
|
|
object2.name = r9;
|
|
show = item.show;
|
|
r9 = show == null ? value : show.images[0];
|
|
object2.image = r9;
|
|
album = item.album;
|
|
r9 = (album == null ? value : album.type) ?? SpotifyResourceTypes.SHOW;
|
|
object2.type = r9;
|
|
object.album = object2;
|
|
object.artists = [];
|
|
object.isLocal = false;
|
|
}
|
|
}
|
|
if (device != null && device.is_active !== true) {
|
|
object = {};
|
|
copyDataProperties(object, device, undefined);
|
|
object['is_active'] = true;
|
|
}
|
|
if (context == null) {
|
|
value = global.Promise.resolve(value);
|
|
r2 = value;
|
|
} else {
|
|
object = [SpotifyResourceTypes.PLAYLIST];
|
|
object[1] = SpotifyResourceTypes.ALBUM;
|
|
if (object.includes(context.type)) {
|
|
playerState = env0_51.getPlayerState(a0);
|
|
if (playerState == null) {
|
|
if (context.type === SpotifyResourceTypes.ALBUM) {
|
|
r1 = global.Promise.resolve(context);
|
|
} else {
|
|
value = SpotifyAPI.get(a0, a1, {url: context.href});
|
|
value = value.then(function(a0) {
|
|
return a0.body;
|
|
});
|
|
value = value.catch(_fun54297);
|
|
r1 = value;
|
|
}
|
|
} else if (playerState.context == null) {
|
|
if (context.type === SpotifyResourceTypes.ALBUM) {
|
|
r1 = global.Promise.resolve(context);
|
|
} else {
|
|
value = SpotifyAPI.get(a0, a1, {url: context.href});
|
|
value = value.then(_fun54296);
|
|
value = value.catch(_fun54297);
|
|
r1 = value;
|
|
}
|
|
} else if (playerState.context.uri === context.uri) {
|
|
Promise = global.Promise;
|
|
r1 = Promise.resolve(playerState.context);
|
|
} else if (context.type === SpotifyResourceTypes.ALBUM) {
|
|
r1 = global.Promise.resolve(context);
|
|
} else {
|
|
value = SpotifyAPI.get(a0, a1, {url: context.href});
|
|
value = value.then(_fun54296);
|
|
value = value.catch(_fun54297);
|
|
r1 = value;
|
|
}
|
|
r2 = r1;
|
|
} else {
|
|
value = global.Promise.resolve(value);
|
|
r2 = value;
|
|
}
|
|
}
|
|
return r2.then(_fun54298);
|
|
function _fun54295(a0) { // fn#54295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:8365, offset: 0x01362114, size: 82 bytes, params: 2, frame: 15
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const isNotNullish2 = GlobalUtilsModule.isNotNullish(a0.id);
|
|
if (isNotNullish2) {
|
|
value = GlobalUtilsModule;
|
|
value = value.isNotNullish(a0.name);
|
|
r0 = value;
|
|
} else {
|
|
r0 = isNotNullish2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun54298(a0) { // fn#54298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9213, offset: 0x0136218b, size: 194 bytes, params: 2, frame: 16
|
|
let value = a0;
|
|
const value2 = null;
|
|
let r0 = value2 == value || value.type !== SpotifyResourceTypes.PLAYLIST;
|
|
r0 = !r0 ? value.public : r0;
|
|
const r5 = r0 ? value : value2;
|
|
value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_PLAYER_STATE',
|
|
accountId: env0_0, track: Inherits, volumePercent: value2 != device ? device.volume_percent : 0,
|
|
isPlaying: is_playing, repeat: repeat_state !== 'off', position: progress_ms, context: r5, device: device});
|
|
}
|
|
|
|
}
|
|
|
|
function getPlayerState(a0, a1) { // fn#54299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9438, offset: 0x0136224d, size: 177 bytes, params: 3, frame: 22
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const SpotifyAPI = (SpotifyActionCreatorsModule).SpotifyAPI;
|
|
const get = SpotifyAPI.get;
|
|
const PLAYER = SpotifyEndpoints.PLAYER;
|
|
const TRACK = SpotifyResourceTypes.TRACK;
|
|
const EPISODE = SpotifyResourceTypes.EPISODE;
|
|
let value = Reflect.apply(get, SpotifyAPI, [a0, a1, {url: PLAYER,
|
|
query: {additional_types: '' + TRACK + ',' + EPISODE}, onlyRetryOnAuthorizationErrors: true}]);
|
|
value = value.then(_fun54300);
|
|
return value.catch(_fun54302);
|
|
function _fun54300(a0) { // fn#54300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9610, offset: 0x013622fe, size: 89 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var value;
|
|
const env0_0 = a0;
|
|
const body = a0.body;
|
|
if (body != null) {
|
|
value = environment.__proto__;
|
|
value = updatePlayerState(env0_0, require, body);
|
|
value.then(_fun54301);
|
|
} else {
|
|
value = environment.__proto__;
|
|
sendStoppedPlayerState(env0_0);
|
|
}
|
|
function _fun54301() { // fn#54301, offset: 0x00c36f09, size: 9 bytes, params: 1, frame: 1
|
|
return env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun54302() { // fn#54302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9710, offset: 0x01362357, size: 23 bytes, params: 1, frame: 11
|
|
sendStoppedPlayerState(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun54303() { // fn#54303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2723, offset: 0x0136236e, size: 216 bytes, params: 1, frame: 15
|
|
return CreateClass(SpotifySocket, [{key: 'connected', get: get_54306}, {key: 'connect', value: value_54307},
|
|
{key: 'disconnect', value: function() {
|
|
var value;
|
|
var error;
|
|
this._requestedDisconnect = true;
|
|
var property = this.backoff;
|
|
property.cancel();
|
|
try {
|
|
property = this.socket;
|
|
value = property == null;
|
|
if (!value) {
|
|
property.close();
|
|
}
|
|
} catch (error) {
|
|
}
|
|
}}, {key: 'ping', value: value_54311}, {key: 'handleOpen', value: value_54312}, {key: 'handleMessage',
|
|
value: value_54314}, {key: 'handleClose', value: value_54315}, {key: 'handleEvent', value: value_54317}]);
|
|
function SpotifySocket(a0, a1) { // fn#54304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2744, offset: 0x01362446, size: 214 bytes, params: 3, frame: 18
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_6(this, SpotifySocket);
|
|
this._requestedDisconnect = false;
|
|
this._requestedConnect = false;
|
|
const defaultImport = Module00022;
|
|
this.handleDeviceStateChange = defaultImport.throttle(_fun54305, env1_33);
|
|
this.accountId = a0;
|
|
this.accessToken = a1;
|
|
const Interval = (TimersModule).Interval;
|
|
const value3 = Object.create(Interval.prototype, {constructor: {value: Interval}});
|
|
const interval = new Interval();
|
|
this.pingInterval = interval instanceof Object ? interval : value3;
|
|
this.backoff = new (importDefault(561) /* metro dependency 561: Backoff */)(undefined, env1_32);
|
|
this.connect();
|
|
function _fun54305() { // fn#54305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:2897, offset: 0x0136251c, size: 80 bytes, params: 1, frame: 16
|
|
const getDevices = SpotifyActionCreatorsModule.getDevices;
|
|
const binding = env0_0;
|
|
Reflect.apply(getDevices, SpotifyActionCreatorsModule, [binding.accountId, binding.accessToken]);
|
|
getPlayerState(binding.accountId, binding.accessToken);
|
|
}
|
|
|
|
}
|
|
|
|
function get_54306() { // fn#54306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:3163, offset: 0x0136256c, size: 49 bytes, params: 1, frame: 12
|
|
var r0;
|
|
var binding;
|
|
let value = this.socket != null;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
binding = env1_49;
|
|
value = binding.has(this.socket.readyState);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_54307() { // fn#54307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:3253, offset: 0x0136259d, size: 126 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var value;
|
|
if (!(this.connected || this._requestedConnect)) {
|
|
value = environment.__proto__;
|
|
env1_38.info('WS Connecting');
|
|
this._requestedDisconnect = false;
|
|
this._requestedConnect = true;
|
|
value = getPlayerState(this.accountId, this.accessToken);
|
|
value = value.then(_fun54308);
|
|
value.catch(_fun54309);
|
|
}
|
|
function _fun54308() { // fn#54308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:3438, offset: 0x0136261b, size: 177 bytes, params: 1, frame: 13
|
|
const binding = env0_0;
|
|
binding._requestedConnect = false;
|
|
const WebSocket = global.WebSocket;
|
|
let value = 'wss://dealer.spotify.com/?access_token=' + binding.accessToken;
|
|
const value2 = Object.create(WebSocket.prototype, {constructor: {value: WebSocket}});
|
|
const webSocket = new WebSocket();
|
|
binding.socket = webSocket instanceof Object ? webSocket : value2;
|
|
let socket = binding.socket;
|
|
socket.onopen = binding.handleOpen.bind(binding);
|
|
binding.socket.onmessage = binding.handleMessage.bind(binding);
|
|
socket = binding.socket;
|
|
const socket2 = binding.socket;
|
|
value = binding.handleClose.bind(binding);
|
|
socket2.onerror = value;
|
|
socket.onclose = value;
|
|
}
|
|
|
|
function _fun54309(a0) { // fn#54309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:3733, offset: 0x013626cc, size: 49 bytes, params: 2, frame: 11
|
|
let binding = env2_38;
|
|
binding.error(a0);
|
|
binding = env0_0;
|
|
binding._requestedConnect = false;
|
|
binding.handleClose();
|
|
}
|
|
|
|
}
|
|
|
|
function value_54311() { // fn#54311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:3959, offset: 0x0136273e, size: 71 bytes, params: 1, frame: 14
|
|
var socket;
|
|
var send;
|
|
var JSON;
|
|
var stringify;
|
|
var value;
|
|
if (this.connected) {
|
|
socket = this.socket;
|
|
if (socket != null) {
|
|
send = socket.send;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
value = environment.__proto__;
|
|
Reflect.apply(send, socket, [Reflect.apply(stringify, JSON, [{type: env1_36}])]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_54312() { // fn#54312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:4076, offset: 0x01362785, size: 156 bytes, params: 1, frame: 18
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_38.info('WS Connected');
|
|
this.backoff.succeed();
|
|
const pingInterval = this.pingInterval;
|
|
pingInterval.start(env1_27, _fun54313);
|
|
(SpotifyActionCreatorsModule).getProfile(this.accountId, this.accessToken);
|
|
(SpotifyActionCreatorsModule).getDevices(this.accountId, this.accessToken);
|
|
function _fun54313() { // fn#54313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:4160, offset: 0x01362821, size: 19 bytes, params: 1, frame: 9
|
|
return env0_0.ping();
|
|
}
|
|
|
|
}
|
|
|
|
function value_54314({data}) { // fn#54314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:4315, offset: 0x01362834, size: 353 bytes, params: 2, frame: 25
|
|
var r8;
|
|
var r12;
|
|
var JSON;
|
|
var parse;
|
|
var value;
|
|
var type;
|
|
var uri;
|
|
var payloads;
|
|
var startsWith;
|
|
var Array;
|
|
var isArray;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var events;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var handleEvent;
|
|
var value8;
|
|
var value9;
|
|
var decodeURIComponent;
|
|
var split;
|
|
var value10;
|
|
var subscribePlayerStateNotifications;
|
|
var accountId;
|
|
var accessToken;
|
|
var connectionId;
|
|
reducibleJoin11: while (true) {
|
|
if (typeof data !== 'string') {
|
|
break reducibleJoin11;
|
|
}
|
|
JSON = global.JSON;
|
|
parse = JSON.parse;
|
|
value = Reflect.apply(parse, JSON, [data]);
|
|
type = value.type;
|
|
uri = value.uri;
|
|
payloads = value.payloads;
|
|
value = environment.__proto__;
|
|
if (type !== env1_35) {
|
|
break reducibleJoin11;
|
|
}
|
|
if (typeof uri === 'string') {
|
|
startsWith = uri.startsWith;
|
|
if (Reflect.apply(startsWith, uri, ['hm://pusher/v1/connections/'])) {
|
|
decodeURIComponent = global.decodeURIComponent;
|
|
split = uri.split;
|
|
value10 = Reflect.apply(split, uri, ['hm://pusher/v1/connections/']);
|
|
this.connectionId = decodeURIComponent(value10[1]);
|
|
value = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
subscribePlayerStateNotifications = value.subscribePlayerStateNotifications;
|
|
accountId = this.accountId;
|
|
accessToken = this.accessToken;
|
|
connectionId = this.connectionId;
|
|
Reflect.apply(subscribePlayerStateNotifications, value, [accountId, accessToken, connectionId]);
|
|
break reducibleJoin11;
|
|
}
|
|
}
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
if (!Reflect.apply(isArray, Array, [payloads])) {
|
|
break reducibleJoin11;
|
|
}
|
|
value2 = _createForOfIteratorHelperLoose_54274(payloads);
|
|
value3 = value2();
|
|
done = value3.done;
|
|
if (done) {
|
|
break reducibleJoin11;
|
|
}
|
|
r8 = value3;
|
|
reducibleLoop6: while (true) {
|
|
value4 = r8.value;
|
|
events = value4.events;
|
|
reducibleJoin9: while (true) {
|
|
if (events == null) {
|
|
break reducibleJoin9;
|
|
}
|
|
value5 = _createForOfIteratorHelperLoose_54274(events);
|
|
value6 = value5();
|
|
done = value6.done;
|
|
if (done) {
|
|
break reducibleJoin9;
|
|
}
|
|
r12 = value6;
|
|
reducibleLoop8: while (true) {
|
|
value7 = r12.value;
|
|
handleEvent = this.handleEvent;
|
|
Reflect.apply(handleEvent, this, [value7]);
|
|
value8 = value5();
|
|
done = value8.done;
|
|
if (done) {
|
|
break reducibleJoin9;
|
|
}
|
|
r12 = value8;
|
|
continue reducibleLoop8;
|
|
}
|
|
}
|
|
value9 = value2();
|
|
done = value9.done;
|
|
if (done) {
|
|
break reducibleJoin11;
|
|
}
|
|
r8 = value9;
|
|
continue reducibleLoop6;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_54315() { // fn#54315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:4849, offset: 0x01362995, size: 127 bytes, params: 1, frame: 15
|
|
var environment;
|
|
var backoff;
|
|
var closure;
|
|
var value;
|
|
var value2;
|
|
var binding;
|
|
var info;
|
|
var Math;
|
|
var error;
|
|
this.pingInterval.stop();
|
|
if (!this._requestedDisconnect) {
|
|
try {
|
|
backoff = this.backoff;
|
|
closure = _fun54316;
|
|
value = backoff.fail(closure);
|
|
value2 = environment.__proto__;
|
|
binding = env1_38;
|
|
info = binding.info;
|
|
Math = global.Math;
|
|
value = Math.round(value);
|
|
value = 'WS Disconnected. Next retry in ' + value + 'ms';
|
|
Reflect.apply(info, binding, [value]);
|
|
} catch (error) {
|
|
}
|
|
}
|
|
function _fun54316() { // fn#54316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:4944, offset: 0x01362a14, size: 34 bytes, params: 1, frame: 9
|
|
if (!env0_0._requestedDisconnect) {
|
|
env0_0.connect();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_54317({type, event}) { // fn#54317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:5092, offset: 0x01362a36, size: 115 bytes, params: 2, frame: 16
|
|
const PLAYER_STATE_CHANGED = env1_34.PLAYER_STATE_CHANGED;
|
|
if (PLAYER_STATE_CHANGED === type) {
|
|
if (event != null && event.state != null) {
|
|
updatePlayerState(this.accountId, this.accessToken, event.state);
|
|
}
|
|
} else if (env1_34.DEVICE_STATE_CHANGED === type) {
|
|
this.handleDeviceStateChange();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun54318(a0) { // fn#54318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9749, offset: 0x01362aa9, size: 333 bytes, params: 2, frame: 16
|
|
const SpotifyStore2 = SpotifyStore;
|
|
Inherits(SpotifyStore2, a0);
|
|
return CreateClass(SpotifyStore2, [{key: 'initialize', value: value_54320}, {key: 'hasConnectedAccount',
|
|
value: value_54324}, {key: 'getActiveSocketAndDevice', value: function() {
|
|
return _getActiveSocketAndDevice();
|
|
}}, {key: 'getPlayableComputerDevices', value: value_54326}, {key: 'canPlay', value: value_54328},
|
|
{key: 'getSyncingWith', value: value_54329}, {key: 'wasAutoPaused', value: value_54330},
|
|
{key: 'getLastPlayedTrackId', value: value_54331}, {key: 'getTrack', value: value_54332},
|
|
{key: 'getPlayerState', value: value_54333}, {key: 'shouldShowActivity', value: value_54334},
|
|
{key: 'getActivity', value: value_54335}]);
|
|
function SpotifyStore() { // fn#54319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9761, offset: 0x01362bf6, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_6(this, SpotifyStore);
|
|
const value3 = env1_4(SpotifyStore);
|
|
return env1_3(this, _isNativeReflectConstruct_54271() ? global.Reflect.construct(value3, arguments,
|
|
env1_4(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_54320() { // fn#54320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10039, offset: 0x01362c67, size: 112 bytes, params: 1, frame: 24
|
|
var environment;
|
|
const waitFor = this.waitFor;
|
|
const value = environment.__proto__;
|
|
Reflect.apply(waitFor, this, [AuthenticationStore, ConnectedAccountsStore, IdleStore, PresenceStore,
|
|
RunningGameStoreNative, SpeakingStore, VoiceStateStore]);
|
|
this.syncWith([PresenceStore], function() {
|
|
return _fun54322();
|
|
});
|
|
(SpotifyActionCreatorsModule).fetchIsSpotifyProtocolRegistered();
|
|
function _fun54321() { // fn#54321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10097, offset: 0x01362cd7, size: 15 bytes, params: 1, frame: 9
|
|
return handlePresenceUpdate();
|
|
function handlePresenceUpdate() { // fn#54322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10101, offset: 0x01362ce6, size: 248 bytes, params: 1, frame: 21
|
|
var environment;
|
|
var r2;
|
|
var binding;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
if (env3_24 == null) {
|
|
return false;
|
|
}
|
|
if (_getActiveSocketAndDevice() == null) {
|
|
return false;
|
|
}
|
|
const userId = env3_24.userId;
|
|
const spotifyActivity = findSpotifyActivity(userId);
|
|
if (spotifyActivity == null) {
|
|
binding = env3_41;
|
|
binding.start(env3_29, _fun54323);
|
|
return false;
|
|
}
|
|
env3_41.stop();
|
|
const sync_id = spotifyActivity.sync_id;
|
|
const timestamps = spotifyActivity.timestamps;
|
|
const party = spotifyActivity.party;
|
|
if (sync_id != null && env3_24.trackId !== sync_id) {
|
|
r2 = activitySync(userId, spotifyActivity, false);
|
|
} else if (timestamps != null && env3_24.startTime !== timestamps.start) {
|
|
r2 = activitySync(userId, spotifyActivity, false);
|
|
} else {
|
|
r2 = party != null && party.id !== env3_24.partyId;
|
|
if (r2) {
|
|
env3_24.partyId = party.id;
|
|
r2 = true;
|
|
}
|
|
}
|
|
return r2;
|
|
function _fun54323() { // fn#54323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10268, offset: 0x01362dde, size: 69 bytes, params: 1, frame: 12
|
|
if (env4_24 != null && env4_24.userId === userId) {
|
|
(importDefault(6872) /* metro dependency 6872: stopSyncingUserActivity */)();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function value_54324() { // fn#54324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10586, offset: 0x01362e23, size: 38 bytes, params: 1, frame: 11
|
|
const Object = global.Object;
|
|
return Object.keys(env1_44).length > 0;
|
|
}
|
|
|
|
function value_54326() { // fn#54326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10756, offset: 0x01362e58, size: 126 bytes, params: 1, frame: 22
|
|
var r6;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var connected;
|
|
var property2;
|
|
var value2;
|
|
const items2 = [];
|
|
for (propertyName in env1_44) {
|
|
property = env1_44[propertyName];
|
|
connected = property.connected;
|
|
if (!connected) {
|
|
r6 = propertyName2;
|
|
continue;
|
|
}
|
|
if (env1_45[propertyName] == null) {
|
|
r6 = propertyName2;
|
|
continue;
|
|
}
|
|
property2 = env1_45[propertyName];
|
|
value2 = property2.find(function(a0) {
|
|
return !a0.is_restricted && a0.type === 'Computer';
|
|
});
|
|
if (value2 == null) {
|
|
r6 = propertyName2;
|
|
continue;
|
|
}
|
|
items2.push({socket: property, device: value2});
|
|
r6 = propertyName2;
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function value_54328({sync_id, party}) { // fn#54328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:10961, offset: 0x01362ef8, size: 79 bytes, params: 2, frame: 15
|
|
const value = environment.__proto__;
|
|
let r0 = _getActiveSocketAndDevice() != null && sync_id != null && party != null;
|
|
r0 = r0 && party.id != null && isSpotifyParty(party.id);
|
|
return r0;
|
|
}
|
|
|
|
function value_54329() { // fn#54329, offset: 0x00df3acd, size: 9 bytes, params: 1, frame: 1
|
|
return env1_24;
|
|
}
|
|
|
|
function value_54330() { // fn#54330, offset: 0x01362f47, size: 9 bytes, params: 1, frame: 1
|
|
return env1_47;
|
|
}
|
|
|
|
function value_54331() { // fn#54331, offset: 0x00df3ad6, size: 9 bytes, params: 1, frame: 1
|
|
return env1_25;
|
|
}
|
|
|
|
function value_54332() { // fn#54332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:11258, offset: 0x01362f50, size: 27 bytes, params: 1, frame: 3
|
|
const value2 = null;
|
|
return value2 != env1_23 ? env1_23.track : value2;
|
|
}
|
|
|
|
function value_54333(a0) { // fn#54333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:11327, offset: 0x01362f6b, size: 16 bytes, params: 2, frame: 2
|
|
return env1_46[a0];
|
|
}
|
|
|
|
function value_54334() { // fn#54334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:11385, offset: 0x01362f7b, size: 54 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
return env1_23 != null && env1_23.account.showActivity && !IdleStore.isIdle();
|
|
}
|
|
|
|
function value_54335() { // fn#54335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:11475, offset: 0x01362fb1, size: 575 bytes, params: 1, frame: 30
|
|
var environment;
|
|
var r7;
|
|
var moduleValue;
|
|
const value = environment.__proto__;
|
|
const value2 = null;
|
|
if (value2 == env1_23) {
|
|
return value2 != env1_24 ? findSpotifyActivity(env1_24.userId) : value2;
|
|
}
|
|
const binding = env1_23;
|
|
const {artists, album, name, id, duration, isLocal, type} = binding.track;
|
|
const startTime = binding.startTime;
|
|
const context = binding.context;
|
|
const value3 = artists.slice(0, 5);
|
|
const length = artists.length;
|
|
const value4 = undefined;
|
|
const r6 = length > 0 ? value3.map(function({name}) {
|
|
return name.replace(RegExp(';', 'g'), '');
|
|
}).join('; ') : value4;
|
|
const object = {};
|
|
if (value2 != album.image) {
|
|
moduleValue = require(6873) /* metro dependency 6873: ApplicationAssetUtils */;
|
|
r7 = moduleValue.getAssetFromImageURL(PlatformTypes.SPOTIFY, album.image.url);
|
|
} else {
|
|
r7 = value2;
|
|
}
|
|
if (value2 != album.image && value2 != r7) {
|
|
object.large_image = r7;
|
|
}
|
|
if (album.type !== env1_37) {
|
|
object.large_text = album.name;
|
|
}
|
|
const uri = value2 != context ? context.uri : value4;
|
|
r7 = value2 == env1_24 ? '' + SPOTIFY_PARTY_PREFIX + AuthenticationStore.getId() : value2 != env1_24.partyId ? env1_24.partyId : '' + SPOTIFY_PARTY_PREFIX + AuthenticationStore.getId();
|
|
const r10 = name.length > 128 ? name.substring(0, 125) + '...' : name;
|
|
const object2 = {context_uri: uri};
|
|
object2.album_id = album.id;
|
|
object2.artist_ids = value3.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
object2.type = type;
|
|
object2.button_urls = [];
|
|
const object3 = {};
|
|
object3.name = env1_26.name;
|
|
object3.assets = object;
|
|
object3.details = r10;
|
|
object3.state = r6;
|
|
object3.timestamps = {start: startTime, end: startTime + duration};
|
|
object3.party = {id: r7};
|
|
if (!isLocal) {
|
|
object3.sync_id = id;
|
|
object3.flags = ActivityFlags.PLAY | ActivityFlags.SYNC;
|
|
object3.metadata = object2;
|
|
}
|
|
return object3;
|
|
}
|
|
|
|
}
|
|
|
|
function SPOTIFY_PROFILE_UPDATE({accountId, isPremium}) { // fn#54340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:12704, offset: 0x01363252, size: 93 bytes, params: 2, frame: 17
|
|
const property = env0_44[accountId];
|
|
if (property == null) {
|
|
return false;
|
|
}
|
|
property.isPremium = isPremium;
|
|
env0_38.info('Profile updated for ' + accountId + ': isPremium = ' + isPremium);
|
|
}
|
|
|
|
function SPOTIFY_PLAYER_STATE({accountId, isPlaying, repeat, track, position, device, context}) { // fn#54341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:12887, offset: 0x013632af, size: 1045 bytes, params: 2, frame: 26
|
|
var r4;
|
|
var r0;
|
|
var r8;
|
|
var r3;
|
|
var r1;
|
|
var object;
|
|
var value6;
|
|
var id;
|
|
var binding3;
|
|
var binding5;
|
|
var info;
|
|
var binding8;
|
|
var binding9;
|
|
var defaultImport3;
|
|
var ACTIVITY_UPDATED;
|
|
var album;
|
|
var name;
|
|
var artists;
|
|
if (device != null) {
|
|
if (env0_45[accountId] != null) {
|
|
value6 = env0_45[accountId].find(function({id}) {
|
|
return id === device.id;
|
|
});
|
|
if (value6 == null) {
|
|
env0_45[accountId].push(device);
|
|
r4 = true;
|
|
} else if ((importDefault(628) /* metro dependency 628: shallowEqual */)(value6, device)) {
|
|
r4 = false;
|
|
} else {
|
|
global.Object.assign(value6, device);
|
|
r4 = true;
|
|
}
|
|
setActiveDevice(accountId, device.id);
|
|
r0 = r4;
|
|
} else {
|
|
env0_45[accountId] = [device];
|
|
r0 = true;
|
|
}
|
|
} else {
|
|
r0 = false;
|
|
}
|
|
let binding = env0_48;
|
|
if (isPlaying) {
|
|
if (binding == null) {
|
|
r8 = track;
|
|
} else {
|
|
binding.start(env0_28, autoPause);
|
|
r8 = track;
|
|
}
|
|
} else if (binding == null) {
|
|
r8 = null;
|
|
} else {
|
|
binding.stop();
|
|
r8 = null;
|
|
}
|
|
const connectedAccountsStoreBinding = ConnectedAccountsStore;
|
|
const getAccount = connectedAccountsStoreBinding.getAccount;
|
|
const SPOTIFY = PlatformTypes.SPOTIFY;
|
|
const value10 = Reflect.apply(getAccount, connectedAccountsStoreBinding, [accountId, SPOTIFY]);
|
|
if (value10 == null) {
|
|
return r0;
|
|
}
|
|
const property = env0_46[accountId];
|
|
if (r8 != null) {
|
|
object = {account: value10, track: r8};
|
|
object.startTime = calculateStartTime(property, position);
|
|
object.context = context;
|
|
object.repeat = repeat;
|
|
r3 = object;
|
|
} else {
|
|
r3 = null;
|
|
}
|
|
const r13 = device != null && env0_24 != null && position === 0 && !isPlaying;
|
|
if (!r13) {
|
|
env0_46[accountId] = r3;
|
|
}
|
|
binding = env0_23;
|
|
env0_23 = (importDefault(22) /* metro dependency 22 */).values(env0_46).find(function(a0) {
|
|
return a0 != null;
|
|
});
|
|
const setSpeakingBinding = setSpeaking;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
setSpeakingBinding(Reflect.apply(getId, authenticationStoreBinding, []));
|
|
if (r8 == null) {
|
|
env0_42.stop();
|
|
} else if (r13) {
|
|
env0_42.stop();
|
|
} else {
|
|
binding3 = env0_42;
|
|
binding3.start(r8.duration - position + env0_30, _fun54344);
|
|
}
|
|
if (env0_24 == null) {
|
|
binding5 = env0_43;
|
|
if (binding5.isStarted()) {
|
|
env0_38.info('Listen along stop cancelled as playback of track resumed');
|
|
env0_43.stop();
|
|
}
|
|
} else if (isPlaying) {
|
|
if (device == null) {
|
|
binding8 = env0_38;
|
|
info = binding8.info;
|
|
binding9 = env0_30;
|
|
Reflect.apply(info, binding8,
|
|
['Listen along active but playback stopped or track changed. Stopping listen along in ' + binding9 + 'ms']);
|
|
env0_43.start(binding9, _fun54345);
|
|
} else if (r3 == null) {
|
|
binding5 = env0_43;
|
|
if (binding5.isStarted()) {
|
|
env0_38.info('Listen along stop cancelled as playback of track resumed');
|
|
env0_43.stop();
|
|
}
|
|
} else if (env0_24.trackId !== r3.track.id) {
|
|
binding8 = env0_38;
|
|
info = binding8.info;
|
|
binding9 = env0_30;
|
|
Reflect.apply(info, binding8,
|
|
['Listen along active but playback stopped or track changed. Stopping listen along in ' + binding9 + 'ms']);
|
|
env0_43.start(binding9, _fun54345);
|
|
} else {
|
|
binding5 = env0_43;
|
|
if (binding5.isStarted()) {
|
|
env0_38.info('Listen along stop cancelled as playback of track resumed');
|
|
env0_43.stop();
|
|
}
|
|
}
|
|
} else if (position > 0) {
|
|
binding8 = env0_38;
|
|
info = binding8.info;
|
|
binding9 = env0_30;
|
|
Reflect.apply(info, binding8,
|
|
['Listen along active but playback stopped or track changed. Stopping listen along in ' + binding9 + 'ms']);
|
|
env0_43.start(binding9, _fun54345);
|
|
} else if (device == null) {
|
|
binding8 = env0_38;
|
|
info = binding8.info;
|
|
binding9 = env0_30;
|
|
Reflect.apply(info, binding8,
|
|
['Listen along active but playback stopped or track changed. Stopping listen along in ' + binding9 + 'ms']);
|
|
env0_43.start(binding9, _fun54345);
|
|
} else if (r3 == null) {
|
|
binding5 = env0_43;
|
|
if (binding5.isStarted()) {
|
|
env0_38.info('Listen along stop cancelled as playback of track resumed');
|
|
env0_43.stop();
|
|
}
|
|
} else if (env0_24.trackId !== r3.track.id) {
|
|
binding8 = env0_38;
|
|
info = binding8.info;
|
|
binding9 = env0_30;
|
|
Reflect.apply(info, binding8,
|
|
['Listen along active but playback stopped or track changed. Stopping listen along in ' + binding9 + 'ms']);
|
|
env0_43.start(binding9, _fun54345);
|
|
} else {
|
|
binding5 = env0_43;
|
|
if (binding5.isStarted()) {
|
|
env0_38.info('Listen along stop cancelled as playback of track resumed');
|
|
env0_43.stop();
|
|
}
|
|
}
|
|
if (binding === env0_23) {
|
|
r1 = r0;
|
|
} else if (property != null) {
|
|
if (property == null) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK',
|
|
track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else if (r3 == null) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK',
|
|
track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else {
|
|
track = property.track;
|
|
id = track.id;
|
|
track = r3.track;
|
|
if (id !== track.id) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK',
|
|
track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else if (property.startTime === r3.startTime) {
|
|
r1 = r0;
|
|
} else if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK',
|
|
track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
}
|
|
} else if (r3 == null) {
|
|
r1 = r0;
|
|
} else if (property == null) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK', track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else if (r3 == null) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK', track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else {
|
|
track = property.track;
|
|
id = track.id;
|
|
track = r3.track;
|
|
if (id !== track.id) {
|
|
if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK',
|
|
track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
} else if (property.startTime === r3.startTime) {
|
|
r1 = r0;
|
|
} else if (r8 != null) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'SPOTIFY_NEW_TRACK', track: r8,
|
|
connectionId: accountId});
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport3.track;
|
|
ACTIVITY_UPDATED = AnalyticEvents.ACTIVITY_UPDATED;
|
|
object = {};
|
|
object.party_platform = PlatformTypes.SPOTIFY;
|
|
id = r8.id;
|
|
object.track_id = id;
|
|
object.has_images = true;
|
|
album = r8.album;
|
|
name = album.name;
|
|
object.details = name;
|
|
name = r8.name;
|
|
object.state = name;
|
|
album = r8.album;
|
|
id = album.id;
|
|
object.album_id = id;
|
|
artists = r8.artists;
|
|
object.author_ids = artists.map(_fun54346);
|
|
artists = r8.artists;
|
|
object.author_names = artists.map(_fun54347);
|
|
Reflect.apply(track, defaultImport3, [ACTIVITY_UPDATED, object]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
}
|
|
return r1;
|
|
function _fun54344() { // fn#54344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:13566, offset: 0x013636c4, size: 28 bytes, params: 1, frame: 11
|
|
sendStoppedPlayerState(env0_1.id);
|
|
}
|
|
|
|
function _fun54345() { // fn#54345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:13775, offset: 0x013636e0, size: 73 bytes, params: 1, frame: 12
|
|
env1_38.info('Stopping listening along');
|
|
(StopSyncingUserActivity)();
|
|
sendStoppedPlayerState(env0_1.id);
|
|
}
|
|
|
|
}
|
|
|
|
function ACTIVITY_PLAY({activity, metadata}) { // fn#54349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:14435, offset: 0x0136373c, size: 325 bytes, params: 2, frame: 25
|
|
var context_uri;
|
|
var r0;
|
|
var value9;
|
|
var moduleValue;
|
|
var play;
|
|
var accountId;
|
|
var binding;
|
|
var info;
|
|
const value3 = _getActiveSocketAndDevice();
|
|
if (value3 == null) {
|
|
return false;
|
|
}
|
|
const socket = value3.socket;
|
|
const device = value3.device;
|
|
const sync_id = activity.sync_id;
|
|
const party = activity.party;
|
|
let r1 = sync_id == null || party == null;
|
|
r1 = !r1 ? party.id == null : r1;
|
|
r1 = !r1 ? !isSpotifyParty(party.id) : r1;
|
|
if (r1) {
|
|
r0 = !r1;
|
|
} else {
|
|
context_uri = metadata?.context_uri;
|
|
if (env0_24 != null) {
|
|
ACTIVITY_SYNC_STOP();
|
|
}
|
|
value9 = metadata != null;
|
|
if (value9) {
|
|
moduleValue = require(6869) /* metro dependency 6869: SpotifyActionCreators */;
|
|
play = moduleValue.play;
|
|
accountId = socket.accountId;
|
|
Reflect.apply(play, moduleValue, [accountId, socket.accessToken, sync_id,
|
|
metadata.type ?? SpotifyResourceTypes.TRACK, {contextUri: context_uri, deviceId: device.id}]);
|
|
binding = env0_38;
|
|
info = binding.info;
|
|
accountId = socket.accountId;
|
|
Reflect.apply(info, binding, ['Play started: ' + accountId + ' playing ' + sync_id + ' on ' + device.name]);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = value9;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function SPOTIFY_SET_DEVICES({accountId, devices}) { // fn#54351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:15060, offset: 0x013638a3, size: 75 bytes, params: 2, frame: 16
|
|
env0_45[accountId] = devices;
|
|
env0_38.info('Devices updated for ' + accountId + ':', devices);
|
|
}
|
|
|
|
function VOICE_STATE_UPDATES_54354({voiceStates}) { // fn#54354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:15357, offset: 0x01363928, size: 32 bytes, params: 2, frame: 13
|
|
return voiceStates.reduce(function(a0, {userId}) {
|
|
setSpeaking(userId);
|
|
return a0;
|
|
}, false);
|
|
function _fun54355(a0, {userId}) { // fn#54355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:15424, offset: 0x01363948, size: 27 bytes, params: 3, frame: 11
|
|
setSpeaking(userId);
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
function MEDIA_ENGINE_SET_GO_LIVE_SOURCE_54356({settings}) { // fn#54356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:15496, offset: 0x01363963, size: 249 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var sourceId;
|
|
var interval;
|
|
let desktopSettings = settings?.desktopSettings;
|
|
if (desktopSettings != null) {
|
|
binding = env0_48;
|
|
if (binding != null) {
|
|
binding.stop();
|
|
}
|
|
desktopSettings = settings?.desktopSettings;
|
|
sourceId = desktopSettings.sourceId;
|
|
if (sourceId == null) {
|
|
binding = env0_48;
|
|
if (binding != null) {
|
|
binding.stop();
|
|
}
|
|
} else if (RunningGameStoreNative.getObservedAppNameForWindow(sourceId) !== env0_26.name) {
|
|
binding = env0_48;
|
|
if (binding != null) {
|
|
binding.stop();
|
|
}
|
|
} else if (desktopSettings.sound) {
|
|
interval = new (require(4041) /* metro dependency 4041: Timers */).Interval();
|
|
interval.start(env0_28, autoPause);
|
|
} else {
|
|
binding = env0_48;
|
|
if (binding != null) {
|
|
binding.stop();
|
|
}
|
|
}
|
|
} else if (settings == null) {
|
|
binding = env0_48;
|
|
if (binding != null) {
|
|
binding.stop();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun54296(a0) { // fn#54296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9096, offset: 0x01362166, size: 10 bytes, params: 2, frame: 1
|
|
return a0.body;
|
|
}
|
|
|
|
function _fun54297(a0) { // fn#54297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:9119, offset: 0x01362170, size: 27 bytes, params: 2, frame: 3
|
|
if (a0) {
|
|
if (a0.status === 404) {
|
|
return null;
|
|
}
|
|
throw a0;
|
|
}
|
|
throw a0;
|
|
}
|
|
|
|
function _fun54346(a0) { // fn#54346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:14300, offset: 0x00e46f8c, size: 10 bytes, params: 2, frame: 1
|
|
return a0.id;
|
|
}
|
|
|
|
function _fun54347(a0) { // fn#54347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7045:14338, offset: 0x00d68953, size: 10 bytes, params: 2, frame: 1
|
|
return a0.name;
|
|
}
|
|
|
|
global.__d(_fun54270, 6867, [15, 17, 18, 6, 7, 4266, 1226, 5040, 4795, 4396, 4607, 4297, 6868, 661, 4915, 672, 3,
|
|
4041, 694, 22, 6869, 561, 683, 628, 6872, 4612, 1360, 6873, 566,
|
|
2]) /* metro module 6867, dependencies: [15, 17, 18, 6, 7, 4266, 1226, 5040, 4795, 4396, 4607, 4297, 6868, 661, 4915, 672, 3, 4041, 694, 22, 6869, 561, 683, 628, 6872, 4612, 1360, 6873, 566, 2] */;
|