234 lines
9.7 KiB
TypeScript
234 lines
9.7 KiB
TypeScript
/* Metro module 8801; source: modules/game_relationships/GameRelationshipActionCreators.tsx; dependencies: [5, 661, 4131, 4647, 1244, 507, 4002, 2] */
|
|
function _fun68819(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:6, offset: 0x01c5e699, size: 236 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const deleteGameRelationship = function() {
|
|
return _deleteGameRelationship.apply(this, arguments);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_4 = constantsModule.Endpoints;
|
|
const env0_5 = constantsModule.RelationshipTypes;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/game_relationships/GameRelationshipActionCreators.tsx');
|
|
exports.default = {removeGameFriend: function() {
|
|
return _removeGameFriend.apply(this, arguments);
|
|
}, acceptGameFriendRequest: function({userId, applicationId}) {
|
|
return _fun68835({userId: userId, applicationId: applicationId, type: RelationshipTypes.FRIEND,
|
|
onSuccess: _fun68838});
|
|
}, cancelGameFriendRequest: function() {
|
|
return _cancelGameFriendRequest.apply(this, arguments);
|
|
}};
|
|
}
|
|
|
|
function showRequestFailedAlert(a0) { // fn#68820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:154, offset: 0x01c5e785, size: 210 bytes, params: 2, frame: 19
|
|
const APIError = (require(4131) /* metro dependency 4131: errors */).APIError;
|
|
const value2 = Object.create(APIError.prototype, {constructor: {value: APIError}});
|
|
const aPIError = new APIError(a0);
|
|
const anyErrorMessage = (aPIError instanceof Object ? aPIError : value2).getAnyErrorMessage();
|
|
const defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
const show = defaultImport.show;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
Reflect.apply(show, defaultImport, [{title: Reflect.apply(string, intl, [t['328j/I']]),
|
|
body: anyErrorMessage ?? intl.string(t.fEptJP)}]);
|
|
}
|
|
|
|
function _deleteGameRelationship() { // fn#68822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:444, offset: 0x01c5e857, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun68824).apply(this, arguments);
|
|
}
|
|
|
|
function _removeGameFriend() { // fn#68825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:729, offset: 0x01c5e937, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun68827).apply(this, arguments);
|
|
}
|
|
|
|
function _cancelGameFriendRequest() { // fn#68829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:1002, offset: 0x01c5ea34, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun68831).apply(this, arguments);
|
|
}
|
|
|
|
function acceptGameFriendRequest({userId, applicationId}) { // fn#68834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:1413, offset: 0x01c5eb31, size: 70 bytes, params: 2, frame: 12
|
|
const FRIEND = RelationshipTypes.FRIEND;
|
|
return addGameRelationship({userId: userId, applicationId: applicationId, type: FRIEND, onSuccess: function() {
|
|
var AccessibilityAnnouncer = require(dependencyMap[6]).AccessibilityAnnouncer;
|
|
AccessibilityAnnouncer.announce(require(dependencyMap[4]).intl.string(require(dependencyMap[4]).t.taJiuc));
|
|
}});
|
|
}
|
|
|
|
async function _fun68824({userId, applicationId, onSuccess}) { // fn#68824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:513, offset: 0x01c5e89d, size: 154 bytes, params: 2, frame: 20
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var HTTP;
|
|
var del;
|
|
var object2;
|
|
var USER_GAME_RELATIONSHIP;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var error;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[5];
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
HTTP = value4.HTTP;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
del = HTTP.del;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env2_4;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
USER_GAME_RELATIONSHIP = binding.USER_GAME_RELATIONSHIP;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(USER_GAME_RELATIONSHIP, binding, [userId, applicationId]);
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
object2.url = value5;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value6 = Reflect.apply(del, HTTP, [object2]);
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
await value6;
|
|
try {
|
|
value7 = undefined;
|
|
value8 = false;
|
|
} catch (error) {
|
|
env2_6(error);
|
|
return undefined;
|
|
}
|
|
if (value8) {
|
|
return value7;
|
|
}
|
|
try {
|
|
onSuccess();
|
|
} catch (error) {
|
|
env2_6(error);
|
|
}
|
|
}
|
|
}
|
|
|
|
async function _fun68827({userId, applicationId}) { // fn#68827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:786, offset: 0x01c5e97d, size: 90 bytes, params: 2, frame: 15
|
|
var environment;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
await env2_7({userId: userId, applicationId: applicationId, onSuccess: onSuccess_68828});
|
|
}
|
|
}
|
|
|
|
async function _fun68831({userId, applicationId}) { // fn#68831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:1073, offset: 0x01c5ea7a, size: 90 bytes, params: 2, frame: 15
|
|
var environment;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
await env2_7({userId: userId, applicationId: applicationId, onSuccess: onSuccess_68832});
|
|
}
|
|
}
|
|
|
|
function addGameRelationship({userId, applicationId, onSuccess, type}) { // fn#68835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:1481, owner: acceptGameFriendRequest.addGameRelationship, offset: 0x01c5eb77, size: 153 bytes, params: 2, frame: 18
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const put = HTTP.put;
|
|
const object2 = {};
|
|
object2.url = Endpoints.USER_GAME_RELATIONSHIP(userId, applicationId);
|
|
object2.body = {type: type};
|
|
object2.oldFormErrors = true;
|
|
object2.rejectWithError = false;
|
|
value = Reflect.apply(put, HTTP, [object2]);
|
|
value = value.then(function() {
|
|
onSuccess();
|
|
});
|
|
return value.catch(function(a0) {
|
|
showRequestFailedAlert(a0);
|
|
var Promise = global.Promise;
|
|
return Promise.reject(a0);
|
|
});
|
|
}
|
|
|
|
function onSuccess_68828() { // fn#68828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:889, offset: 0x01c5e9d7, size: 93 bytes, params: 1, frame: 16
|
|
const binding = env3_0;
|
|
const binding2 = env3_2;
|
|
const AccessibilityAnnouncer = binding(binding2[6]).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = binding(binding2[4]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [intl.string(binding(binding2[4]).t.zRf8cO)]);
|
|
}
|
|
|
|
function onSuccess_68832() { // fn#68832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8986:1176, offset: 0x01c5ead4, size: 93 bytes, params: 1, frame: 16
|
|
const binding = env3_0;
|
|
const binding2 = env3_2;
|
|
const AccessibilityAnnouncer = binding(binding2[6]).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = binding(binding2[4]).intl;
|
|
const string = intl.string;
|
|
const XMf21q = binding(binding2[4]).t.XMf21q;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(string, intl, [XMf21q])]);
|
|
}
|
|
|