429 lines
20 KiB
TypeScript
429 lines
20 KiB
TypeScript
/* Metro module 13025; source: modules/rpc/server/commands/invites.tsx; dependencies: [5, 1378, 1379, 4135, 661, 482, 13026, 4122, 8077, 10647, 13029, 677, 7860, 2] */
|
|
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import EmbeddedActivitiesStore from '../../../activities/EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as ConstantsModule2 from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as OAuth2ScopesModule from '../../../../external/discord_common/js/shared/shared-constants/OAuth2Scopes.tsx'; /* Metro dependency 4122 */
|
|
import * as ConstantsModule3 from '../../Constants.tsx'; /* Metro dependency 4135 */
|
|
|
|
function _fun99426(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:6, offset: 0x021c812b, size: 339 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const RPC_SCOPE_CONFIG = (ConstantsModule3).RPC_SCOPE_CONFIG;
|
|
let value = ConstantsModule;
|
|
const RPCCommands = value.RPCCommands;
|
|
const env0_6 = value.RPCErrors;
|
|
object = {};
|
|
const INVITE_USER_EMBEDDED = RPCCommands.INVITE_USER_EMBEDDED;
|
|
value = require(13026) /* metro dependency 13026: rpcSchema */;
|
|
const createRPCCommand = value.createRPCCommand;
|
|
const INVITE_USER_EMBEDDED2 = RPCCommands.INVITE_USER_EMBEDDED;
|
|
const ANY = RPC_SCOPE_CONFIG.ANY;
|
|
const {DM_CHANNELS_MESSAGES_WRITE,
|
|
ACTIVITIES_INVITES_WRITE} = (OAuth2ScopesModule).OAuth2Scopes;
|
|
object[INVITE_USER_EMBEDDED] = Reflect.apply(createRPCCommand, value, [INVITE_USER_EMBEDDED2,
|
|
{scope: {[ANY]: [DM_CHANNELS_MESSAGES_WRITE, ACTIVITIES_INVITES_WRITE]}, handler: function({socket, args}) {
|
|
var env0_1 = args.user_id;
|
|
return args.content(_fun99428)();
|
|
}}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/rpc/server/commands/invites.tsx');
|
|
exports.default = object;
|
|
function handler_99427({socket, args}) { // fn#99427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:421, offset: 0x021c827e, size: 67 bytes, params: 2, frame: 11
|
|
const env0_1 = args.user_id;
|
|
return args.content(_fun99429)();
|
|
function _fun99428() { // fn#99428, offset: 0x021c82c1, size: 11 bytes, params: 1, frame: 1
|
|
return _fun99429;
|
|
}
|
|
|
|
function* _fun99429() { // fn#99429, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13215:465, offset: 0x021c82cc, size: 887 bytes, params: 1, frame: 21
|
|
var r8;
|
|
var binding;
|
|
var RPCError;
|
|
var object;
|
|
var prototype;
|
|
var rPCError;
|
|
var value5;
|
|
var type;
|
|
var value6;
|
|
var binding2;
|
|
var property;
|
|
var value7;
|
|
var sendEmbeddedActivityInviteUser;
|
|
var id2;
|
|
var object2;
|
|
var ACTIVITY_INVITE;
|
|
var value8;
|
|
var error;
|
|
var UNKNOWN_ERROR;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__;
|
|
const id = env1_0.application.id;
|
|
if (id == null) {
|
|
value = environment.__proto__.__proto__;
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_COMMAND}, 'No application.');
|
|
}
|
|
const connectedActivityLocation = env2_3.getConnectedActivityLocation();
|
|
if (connectedActivityLocation == null) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.NO_ELIGIBLE_ACTIVITY},
|
|
'No eligible activity for application. Ensure an activity was set using setActivity.');
|
|
}
|
|
const kind = connectedActivityLocation.kind;
|
|
const EmbeddedActivityLocationKind = env2_0(env2_1[9]).EmbeddedActivityLocationKind;
|
|
const GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
if (GUILD_CHANNEL === kind) {
|
|
binding = env2_0;
|
|
value6 = binding(env2_1[10]);
|
|
r8 = value6.validateOpenInviteDialog().channel;
|
|
} else {
|
|
binding = env2_0;
|
|
if (binding(env2_1[9]).EmbeddedActivityLocationKind.GUILD_CHANNEL_MESSAGE === kind) {
|
|
binding = env2_0;
|
|
value6 = binding(env2_1[10]);
|
|
r8 = value6.validateOpenInviteDialog().channel;
|
|
} else {
|
|
binding = env2_0;
|
|
if (binding(env2_1[9]).EmbeddedActivityLocationKind.PRIVATE_CHANNEL === kind) {
|
|
binding = env2_4;
|
|
value5 = binding.getChannel(connectedActivityLocation.channel_id);
|
|
if (value5 == null) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid channel');
|
|
}
|
|
type = value5.type;
|
|
binding = env2_0;
|
|
if (type === binding(env2_1[11]).ChannelTypes.DM) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL},
|
|
'Cannot send invite to a DM');
|
|
}
|
|
r8 = value5;
|
|
} else {
|
|
binding = env2_0;
|
|
if (binding(env2_1[9]).EmbeddedActivityLocationKind.PRIVATE_CHANNEL_MESSAGE !== kind) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.NO_ELIGIBLE_ACTIVITY},
|
|
'Unsupported activity location');
|
|
}
|
|
binding = env2_4;
|
|
value5 = binding.getChannel(connectedActivityLocation.channel_id);
|
|
if (value5 == null) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL}, 'Invalid channel');
|
|
}
|
|
type = value5.type;
|
|
binding = env2_0;
|
|
if (type === binding(env2_1[11]).ChannelTypes.DM) {
|
|
throw new env2_0(env2_1[8]).RPCError({errorCode: env2_6.INVALID_CHANNEL},
|
|
'Cannot send invite to a DM');
|
|
}
|
|
r8 = value5;
|
|
}
|
|
}
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
binding2 = env2_1;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
property = binding2[12];
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
value7 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
sendEmbeddedActivityInviteUser = value7.sendEmbeddedActivityInviteUser;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
id2 = r8.id;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.channelId = id2;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.applicationId = id;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
binding = env1_1;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.userId = binding;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
binding = env1_2;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.prefixedContent = binding;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.location = 'RPC_ACTIVITY_INVITE_USER';
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
binding = env2_5;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
ACTIVITY_INVITE = binding.ACTIVITY_INVITE;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object2.source = ACTIVITY_INVITE;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
object.inviteAnalyticsMetadata = object2;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
try {
|
|
value = Reflect.apply(sendEmbeddedActivityInviteUser, value7, [object]);
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
yield value;
|
|
try {
|
|
value = undefined;
|
|
value8 = false;
|
|
} catch (error) {
|
|
binding = env2_0;
|
|
RPCError = binding(env2_1[8]).RPCError;
|
|
object = {};
|
|
UNKNOWN_ERROR = env2_6.UNKNOWN_ERROR;
|
|
object.errorCode = UNKNOWN_ERROR;
|
|
prototype = RPCError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: RPCError}});
|
|
rPCError = new RPCError(object, 'Failed to invite user');
|
|
value = rPCError instanceof Object ? rPCError : value;
|
|
throw value;
|
|
}
|
|
return value8 ? value : undefined;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun99426, 13025, [5, 1378, 1379, 4135, 661, 482, 13026, 4122, 8077, 10647, 13029, 677, 7860,
|
|
2]) /* metro module 13025, dependencies: [5, 1378, 1379, 4135, 661, 482, 13026, 4122, 8077, 10647, 13029, 677, 7860, 2] */;
|