174 lines
9.6 KiB
TypeScript
174 lines
9.6 KiB
TypeScript
/* Metro module 11328; source: actions/ActivitiesActionCreators.tsx; dependencies: [5, 1379, 661, 4503, 694, 507, 7076, 7067, 4863, 4603, 2] */
|
|
function _fun86486(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:6, offset: 0x01f95e96, size: 265 bytes, params: 8, frame: 19
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = constantsModule.Endpoints;
|
|
const env0_6 = constantsModule.ActivityTypes;
|
|
const env0_7 = constantsModule.AnalyticEvents;
|
|
const env0_8 = constantsModule.LoggingInviteTypes;
|
|
const env0_9 = (require(4503) /* metro dependency 4503: MessageConstants */).MessageSendLocation;
|
|
object2 = {updateActivity: updateActivity, sendActivityInvite: sendActivityInvite,
|
|
sendActivityInviteUser: sendActivityInviteUser, getJoinSecret: getJoinSecret,
|
|
subscribeActivities: subscribeActivities};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/ActivitiesActionCreators.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
function updateActivity({applicationId, distributor, shareActivity, token, duration, closed, exePath, voiceChannelId, sessionId, mediaSessionId}) { // fn#86487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:233, offset: 0x01f95f9f, size: 318 bytes, params: 2, frame: 25
|
|
token = token === undefined ? null : token;
|
|
duration = duration === undefined ? 0 : duration;
|
|
closed = !(closed === undefined) && closed;
|
|
exePath = exePath === undefined ? null : exePath;
|
|
voiceChannelId = voiceChannelId === undefined ? null : voiceChannelId;
|
|
sessionId = sessionId === undefined ? null : sessionId;
|
|
mediaSessionId = mediaSessionId === undefined ? null : mediaSessionId;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun86488);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const ACTIVITIES = Endpoints.ACTIVITIES;
|
|
let value = Reflect.apply(post, HTTP, [{'url': null, 'body': null, 'retries': 1, 'oldFormErrors': true,
|
|
'rejectWithError': true, url: ACTIVITIES, body: {application_id: applicationId, token: token,
|
|
duration: duration, share_activity: shareActivity, distributor: distributor, closed: closed, exePath: exePath,
|
|
voice_channel_id: voiceChannelId, session_id: sessionId, media_session_id: mediaSessionId}}]);
|
|
value = value.then(_fun86489);
|
|
value.catch(_fun86490);
|
|
}
|
|
|
|
function sendActivityInvite({channelId, type, activity, content, targetUserId, location}) { // fn#86491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:959, offset: 0x01f961c6, size: 250 bytes, params: 2, frame: 24
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
if (channel == null) {
|
|
return global.Promise.resolve(null);
|
|
}
|
|
const defaultImport = importDefault(7076) /* metro dependency 7076: MessageParser */;
|
|
const value4 = defaultImport.parse(channel, content ?? '');
|
|
const defaultImport2 = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
|
|
const sendMessage = defaultImport2.sendMessage;
|
|
const id = channel.id;
|
|
const ACTIVITY_SHARE = MessageSendLocation.ACTIVITY_SHARE;
|
|
return Reflect.apply(sendMessage, defaultImport2, [id, value4, false, {activityAction: {type: type,
|
|
activity: activity, targetUserId: targetUserId}, location: ACTIVITY_SHARE}]).then(_fun86492, function(a0) {
|
|
var Promise = global.Promise;
|
|
return Promise.reject(a0);
|
|
});
|
|
}
|
|
|
|
function sendActivityInviteUser({userId, type, activity, content, location}) { // fn#86494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:1534, offset: 0x01f9638b, size: 109 bytes, params: 2, frame: 13
|
|
let value = importDefault(4603) /* metro dependency 4603: ChannelActionCreators */;
|
|
value = value.ensurePrivateChannel(userId);
|
|
return value.then(_fun86495);
|
|
}
|
|
|
|
function getJoinSecret(a0, a1, a2, a3, a4) { // fn#86496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:1751, offset: 0x01f96436, size: 64 bytes, params: 6, frame: 11
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const env0_4 = a4;
|
|
return env0_3(_fun86498)();
|
|
}
|
|
|
|
function subscribeActivities(a0) { // fn#86499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:2019, offset: 0x01f9654b, size: 36 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return env0_3(_fun86501)();
|
|
}
|
|
|
|
function _fun86488() { // fn#86488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:425, offset: 0x01f960dd, size: 77 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
return (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ACTIVITY_UPDATE_START',
|
|
applicationId: applicationId, duration: duration, distributor: distributor});
|
|
}
|
|
|
|
function _fun86489({body}) { // fn#86489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:755, offset: 0x01f9612a, size: 96 bytes, params: 2, frame: 15
|
|
const token = body.token;
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ACTIVITY_UPDATE_SUCCESS',
|
|
applicationId: applicationId, token: token, duration: duration, distributor: distributor});
|
|
}
|
|
|
|
function _fun86490() { // fn#86490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:886, offset: 0x01f9618a, size: 60 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ACTIVITY_UPDATE_FAIL',
|
|
applicationId: applicationId});
|
|
}
|
|
|
|
function _fun86492(a0) { // fn#86492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:1267, offset: 0x01f962c0, size: 203 bytes, params: 2, frame: 18
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const INVITE_SENT = AnalyticEvents.INVITE_SENT;
|
|
const object2 = {};
|
|
object2.location = location;
|
|
const type = activity.type;
|
|
const LISTENING = ActivityTypes.LISTENING;
|
|
object2.invite_type = type === LISTENING ? LoggingInviteTypes.SPOTIFY : LoggingInviteTypes.APPLICATION;
|
|
object2.application_id = activity.application_id;
|
|
const binding = env0_2;
|
|
object2.guild_id = binding.getGuildId();
|
|
object2.channel_id = binding.id;
|
|
value = null;
|
|
object2.message_id = value != a0 ? a0.body.id : value;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [INVITE_SENT, object2]);
|
|
const Promise = global.Promise;
|
|
return Promise.resolve(env0_2);
|
|
}
|
|
|
|
function _fun86495(a0) { // fn#86495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:1653, offset: 0x01f963f8, size: 62 bytes, params: 2, frame: 13
|
|
return env0_0.sendActivityInvite({channelId: a0, type: type, activity: activity, content: content,
|
|
location: location});
|
|
}
|
|
|
|
function* _fun86498() { // fn#86498, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:1767, offset: 0x01f96481, size: 202 bytes, params: 1, frame: 20
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const object3 = {};
|
|
value = environment.__proto__;
|
|
if (env1_3 != null) {
|
|
object3.channel_id = env1_3;
|
|
}
|
|
if (ChannelStore != null) {
|
|
object3.message_id = ChannelStore;
|
|
}
|
|
const HTTP = env2_0(env2_2[5]).HTTP;
|
|
const get = HTTP.get;
|
|
const object4 = {};
|
|
object4.url = env2_5.USER_ACTIVITY_JOIN(require, importDefault, dependencyMap);
|
|
object4.retries = 3;
|
|
object4.query = object3;
|
|
object4.rejectWithError = false;
|
|
yield Reflect.apply(get, HTTP, [object4]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return {secret: value.body.secret, joinUrl: value.body.join_url};
|
|
}
|
|
|
|
function* _fun86501() { // fn#86501, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11514:2025, offset: 0x01f9657a, size: 142 bytes, params: 1, frame: 14
|
|
var environment;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__;
|
|
value = require.map(function({userId, applicationId, partyId, messageId, channelId}) {
|
|
return {user_id: userId, application_id: applicationId, party_id: partyId, message_id: messageId,
|
|
channel_id: channelId};
|
|
});
|
|
const HTTP = env2_0(env2_2[5]).HTTP;
|
|
const post = HTTP.post;
|
|
const USER_ACTIVITY_SUBSCRIBE = env2_5.USER_ACTIVITY_SUBSCRIBE;
|
|
yield Reflect.apply(post, HTTP, [{url: USER_ACTIVITY_SUBSCRIBE, body: {subscriptions: value}, retries: 1,
|
|
rejectWithError: false}]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return value.body;
|
|
}
|
|
|