678 lines
35 KiB
TypeScript
678 lines
35 KiB
TypeScript
/* Metro module 7151; source: modules/reactions/ReactionActionCreators.tsx; dependencies: [5, 1226, 1379, 4814, 661, 672, 4647, 1244, 1239, 694, 7152, 507, 7153, 683, 4863, 4002, 7171, 3801, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import MessageStore from '../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as MessageReactionsTypesModule from '../messages/MessageReactionsTypes.tsx'; /* Metro dependency 7152 */
|
|
|
|
function _fun57224(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6, offset: 0x013dfc2d, size: 538 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const closure = function() {
|
|
return _addReaction.apply(this, arguments);
|
|
};
|
|
const closure2 = function() {
|
|
return _removeAllReactions.apply(this, arguments);
|
|
};
|
|
const closure3 = function() {
|
|
return _removeEmojiReactions.apply(this, arguments);
|
|
};
|
|
const closure4 = function() {
|
|
return _removeReaction.apply(this, arguments);
|
|
};
|
|
const getOptimisticEmojiColors = function() {
|
|
return _getOptimisticEmojiColors.apply(this, arguments);
|
|
};
|
|
const hasUserAlreadyReacted2 = hasUserAlreadyReacted;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/reactions/ReactionActionCreators.tsx');
|
|
exports.ReactionLocations = {MESSAGE: 'Message', FORUM_TOOLBAR: 'Forum Toolbar',
|
|
MOBILE_MEDIA_VIEWER: 'Mobile Media Viewer', MESSAGE_HOVER_BAR: 'Message Hover Bar',
|
|
MESSAGE_INLINE_BUTTON: 'Message Inline Button', MESSAGE_CONTEXT_MENU: 'Message Context Menu',
|
|
MESSAGE_REACTION_PICKER: 'Message Reaction Picker', MESSAGE_SHORTCUT: 'Message Shortcut',
|
|
DOUBLE_TAP: 'Double Tap', IN_APP_NOTIFICATION: 'In App Notification'};
|
|
exports.getReactors = function() {
|
|
return _getReactors.apply(this, arguments);
|
|
};
|
|
exports.addReaction = closure;
|
|
exports.playBurstReaction = playBurstReaction;
|
|
exports.removeAllReactions = closure2;
|
|
exports.removeEmojiReactions = closure3;
|
|
exports.removeReaction = closure4;
|
|
exports.hasUserAlreadyReacted = hasUserAlreadyReacted2;
|
|
function checkReactionResponse({headers, status, body}, a1, a2) { // fn#57225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:633, offset: 0x013dfe47, size: 481 bytes, params: 4, frame: 22
|
|
var r4;
|
|
var int;
|
|
var ComponentDispatch;
|
|
var defaultImport;
|
|
var show;
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
if (status === 429) {
|
|
if (a2.isRetry) {
|
|
return true;
|
|
}
|
|
int = global.parseInt(headers['retry-after']);
|
|
if (!global.isNaN(int)) {
|
|
global.setTimeout(a1, int * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND);
|
|
}
|
|
} else {
|
|
if (status === 403) {
|
|
r4 = body && body.code;
|
|
if (AbortCodes.TOO_MANY_REACTIONS === r4) {
|
|
defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
show = defaultImport.show;
|
|
object = {};
|
|
object.title = intl.string(t.lFddsR);
|
|
object.body = intl.string(t.h27eIm);
|
|
object.confirmText = intl.string(t.BddRzS);
|
|
Reflect.apply(show, defaultImport, [object]);
|
|
} else if (AbortCodes.REACTION_BLOCKED === r4) {
|
|
ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
ComponentDispatch.dispatch(ComponentActions.SHAKE_APP, {'duration': 200, 'intensity': 2});
|
|
}
|
|
return true;
|
|
}
|
|
if (a2.isRetry) {
|
|
return true;
|
|
}
|
|
a1();
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function optimisticDispatch(a0, a1, a2, a3, a4) { // fn#57226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:1187, offset: 0x013e0028, size: 226 bytes, params: 6, frame: 18
|
|
const ReactionTypes = (MessageReactionsTypesModule).ReactionTypes;
|
|
const value2 = undefined;
|
|
const defaultImport = Dispatcher;
|
|
const dispatch = defaultImport.dispatch;
|
|
const userId = a4 == null ? value2 : a4.userId;
|
|
Reflect.apply(dispatch, defaultImport, [{type: a0, channelId: a1, messageId: a2,
|
|
userId: userId ?? AuthenticationStore.getId(), emoji: a3, optimistic: true,
|
|
colors: (a4 == null ? value2 : a4.colors) ?? [],
|
|
reactionType: a4 == null ? ReactionTypes.NORMAL : a4.burst ? ReactionTypes.BURST : ReactionTypes.NORMAL}]);
|
|
return value2;
|
|
}
|
|
|
|
function makeURL({channelId, messageId, emoji, userId, useTypeEndpoint, type}) { // fn#57227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:1495, offset: 0x013e010a, size: 231 bytes, params: 2, frame: 24
|
|
useTypeEndpoint = !(useTypeEndpoint === undefined) && useTypeEndpoint;
|
|
const r6 = type !== undefined ? type : (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.NORMAL;
|
|
const r3 = emoji.id != null ? '' + emoji.name + ':' + emoji.id : emoji.name;
|
|
return userId == null ? Endpoints.REACTIONS(channelId, messageId,
|
|
r3) : useTypeEndpoint ? Endpoints.REACTION_WITH_TYPE(channelId, messageId, r3, userId,
|
|
r6) : Endpoints.REACTION(channelId, messageId, r3, userId);
|
|
}
|
|
|
|
function _getReactors() { // fn#57228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:1746, offset: 0x013e01f1, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57230).apply(this, arguments);
|
|
async function _fun57230({channelId, messageId, emoji, limit, after, type}) { // fn#57230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:1793, offset: 0x013e0233, size: 370 bytes, params: 2, frame: 25
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let ReactionTypes = env2_0(env2_2[10]).ReactionTypes;
|
|
let VOTE = ReactionTypes.VOTE;
|
|
const r12 = type === VOTE ? env2_10.POLL_ANSWER_VOTERS(channelId, messageId,
|
|
emoji.id ?? emoji.name) : env2_14({channelId: channelId, messageId: messageId, emoji: emoji});
|
|
const HTTP = env2_0(env2_2[11]).HTTP;
|
|
const get = HTTP.get;
|
|
await Reflect.apply(get, HTTP, [{url: r12, query: {limit: limit, after: after, type: type}, oldFormErrors: true,
|
|
rejectWithError: false}]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
ReactionTypes = env2_0(env2_2[10]).ReactionTypes;
|
|
VOTE = ReactionTypes.VOTE;
|
|
const r3 = type === VOTE ? undefined.body.users : undefined.body;
|
|
value = env2_1(env2_2[9]);
|
|
value.dispatch({type: 'MESSAGE_REACTION_ADD_USERS', channelId: channelId, messageId: messageId, users: r3,
|
|
emoji: emoji, reactionType: type});
|
|
return r3;
|
|
}
|
|
|
|
}
|
|
|
|
function _addReaction() { // fn#57232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:2421, offset: 0x013e03a5, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57234).apply(this, arguments);
|
|
async function _fun57234(a0, a1, a2) { // fn#57234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:2468, offset: 0x013e03e7, size: 660 bytes, params: 4, frame: 30
|
|
var environment;
|
|
var binding;
|
|
var binding2;
|
|
var value5;
|
|
var show;
|
|
var object;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
var value6;
|
|
var value8;
|
|
var HTTP;
|
|
var put;
|
|
var object3;
|
|
var ReactionTypes;
|
|
let value = a3;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const r11 = value !== undefined ? value : env2_11.MESSAGE;
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
let r9 = a4 != null && !!a4.burst;
|
|
if (a4 != null && !!a4.isRetry) {
|
|
value = environment.__proto__.__proto__;
|
|
await env2_24(a2, r9);
|
|
value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
binding = env2_13;
|
|
binding('MESSAGE_REACTION_ADD', a0, a1, a2, {burst: r9, colors: value6});
|
|
binding = env2_1;
|
|
value8 = binding(env2_2[12]);
|
|
await value8.unarchiveThreadIfNecessary(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[11]).HTTP;
|
|
put = HTTP.put;
|
|
object = {};
|
|
binding = env2_14;
|
|
object.url = binding({channelId: a0, messageId: a1, emoji: a2, userId: '@me'});
|
|
object3 = {location: r11};
|
|
binding = env2_0;
|
|
ReactionTypes = binding(env2_2[10]).ReactionTypes;
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
if (env2_26(a0, a1, a2, r9)) {
|
|
binding = env2_1;
|
|
binding2 = env2_2;
|
|
value5 = binding(binding2[6]);
|
|
show = value5.show;
|
|
object = {};
|
|
binding = env2_0;
|
|
intl = binding(binding2[7]).intl;
|
|
string = intl.string;
|
|
t = binding(binding2[7]).t;
|
|
object.title = Reflect.apply(string, intl, [t['uaUU/g']]);
|
|
intl = binding(binding2[7]).intl;
|
|
string = intl.string;
|
|
t = binding(binding2[7]).t;
|
|
object.body = Reflect.apply(string, intl, [t.psMorl]);
|
|
intl = binding(binding2[7]).intl;
|
|
string = intl.string;
|
|
t = binding(binding2[7]).t;
|
|
object.confirmText = Reflect.apply(string, intl, [t['NX+WJN']]);
|
|
Reflect.apply(show, value5, [object]);
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
await env2_24(a2, r9);
|
|
value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
env2_13('MESSAGE_REACTION_ADD', a0, a1, a2, {burst: r9, colors: value6});
|
|
value8 = env2_1(env2_2[12]);
|
|
await value8.unarchiveThreadIfNecessary(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
HTTP = env2_0(env2_2[11]).HTTP;
|
|
put = HTTP.put;
|
|
object = {};
|
|
object.url = env2_14({channelId: a0, messageId: a1, emoji: a2, userId: '@me'});
|
|
object3 = {location: r11};
|
|
ReactionTypes = env2_0(env2_2[10]).ReactionTypes;
|
|
}
|
|
r9 = r9 ? ReactionTypes.BURST : ReactionTypes.NORMAL;
|
|
object3.type = r9;
|
|
object.query = object3;
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
value = Reflect.apply(put, HTTP, [object]);
|
|
value = value.then(_fun57235);
|
|
return value.catch(_fun57236);
|
|
function _fun57235() { // fn#57235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:2956, offset: 0x013e067b, size: 466 bytes, params: 1, frame: 22
|
|
var r12;
|
|
var guild_id;
|
|
var value2;
|
|
var binding;
|
|
var getChannel;
|
|
var binding2;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var track;
|
|
var MESSAGE_SHORTCUT_ACTION_SENT;
|
|
var object;
|
|
var value6;
|
|
var collectGuildAnalyticsMetadata;
|
|
var value7;
|
|
var value8;
|
|
var value10;
|
|
var triggerFullscreenAnimation;
|
|
var object2;
|
|
if (Module00005 === 'Message Shortcut') {
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_5;
|
|
getChannel = binding.getChannel;
|
|
binding2 = env0_0;
|
|
value3 = Reflect.apply(getChannel, binding, [binding2]);
|
|
binding = env3_1;
|
|
value4 = undefined;
|
|
value5 = binding(env3_2[13]);
|
|
track = value5.track;
|
|
MESSAGE_SHORTCUT_ACTION_SENT = env3_8.MESSAGE_SHORTCUT_ACTION_SENT;
|
|
object = {channel_id: binding2};
|
|
guild_id = value3 == null ? value4 : value3.guild_id;
|
|
object.guild_id = guild_id;
|
|
object.original_message_id = require;
|
|
object.emoji_id = importDefault.id ?? importDefault.name;
|
|
object.action = 'react';
|
|
binding = env3_0;
|
|
value6 = binding(env3_2[14]);
|
|
collectGuildAnalyticsMetadata = value6.collectGuildAnalyticsMetadata;
|
|
value7 = value3 == null;
|
|
guild_id = value7 ? value4 : value3.guild_id;
|
|
copyDataProperties(object, Reflect.apply(collectGuildAnalyticsMetadata, value6, [guild_id]), value7);
|
|
binding = env3_0;
|
|
value8 = binding(env3_2[14]);
|
|
copyDataProperties(object, value8.collectChannelAnalyticsMetadata(value3), value7);
|
|
Reflect.apply(track, value5, [MESSAGE_SHORTCUT_ACTION_SENT, object]);
|
|
r12 = value7;
|
|
}
|
|
binding = env0_4;
|
|
const binding3 = env3_0;
|
|
const binding4 = env3_2;
|
|
const AccessibilityAnnouncer = binding3(binding4[15]).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = binding3(binding4[7]).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const t = binding3(binding4[7]).t;
|
|
if (binding) {
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(formatToPlainString, intl, [t['RJlG+R'],
|
|
{name: importDefault.name}])]);
|
|
value10 = env3_1(binding4[16]);
|
|
triggerFullscreenAnimation = value10.triggerFullscreenAnimation;
|
|
object = {channelId: env0_0};
|
|
object.messageId = require;
|
|
object2 = {};
|
|
copyDataProperties(object2, importDefault, r12);
|
|
object2['animated'] = false;
|
|
object.emoji = object2;
|
|
Reflect.apply(triggerFullscreenAnimation, value10, [object]);
|
|
} else {
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(formatToPlainString, intl, [t.ol4acF,
|
|
{name: importDefault.name}])]);
|
|
}
|
|
}
|
|
|
|
function _fun57236(a0) { // fn#57236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:3614, offset: 0x013e084d, size: 233 bytes, params: 2, frame: 22
|
|
var binding3;
|
|
var binding4;
|
|
var AccessibilityAnnouncer;
|
|
var announce;
|
|
var intl;
|
|
var formatToPlainString;
|
|
var t;
|
|
let binding = env3_12;
|
|
const object = {};
|
|
object.isRetry = env0_5;
|
|
if (binding(a0, _fun57237, object)) {
|
|
binding = env3_13;
|
|
binding('MESSAGE_REACTION_REMOVE', env0_0, require, importDefault, {burst: env0_4});
|
|
binding = env0_4;
|
|
binding3 = env3_0;
|
|
binding4 = env3_2;
|
|
AccessibilityAnnouncer = binding3(binding4[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding3(binding4[7]).intl;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
t = binding3(binding4[7]).t;
|
|
if (binding) {
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(formatToPlainString, intl, [t.fJeu87,
|
|
{name: importDefault.name}])]);
|
|
} else {
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(formatToPlainString, intl, [t['UUn5V+'],
|
|
{name: importDefault.name}])]);
|
|
}
|
|
}
|
|
function _fun57237() { // fn#57237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:3643, offset: 0x013e0936, size: 55 bytes, params: 1, frame: 19
|
|
return env4_16(env1_0, require, importDefault, env1_3, {burst: env1_4, isRetry: true});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _removeAllReactions() { // fn#57239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4254, offset: 0x013e096d, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57241).apply(this, arguments);
|
|
function* _fun57241(a0, a1, a2) { // fn#57241, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4315, offset: 0x013e09a6, size: 197 bytes, params: 4, frame: 20
|
|
var environment;
|
|
if (true) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
var env0_2;
|
|
value = a2 != null;
|
|
env0_2 = value && !!a2.isRetry;
|
|
value = environment.__proto__.__proto__;
|
|
var value3 = env2_1(env2_2[12]);
|
|
yield value3.unarchiveThreadIfNecessary(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var HTTP = env2_0(env2_2[11]).HTTP;
|
|
var del = HTTP.del;
|
|
var object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = env2_10.REMOVE_REACTIONS(a0, a1);
|
|
Reflect.apply(del, HTTP, [object]).catch(_fun57242);
|
|
}
|
|
function _fun57242(a0) { // fn#57242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4496, offset: 0x013e0a6b, size: 42 bytes, params: 2, frame: 15
|
|
env3_12(a0, _fun57243, {isRetry: env0_2});
|
|
function _fun57243() { // fn#57243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4525, offset: 0x013e0a95, size: 38 bytes, params: 1, frame: 15
|
|
return env4_18(env1_0, require, {isRetry: true});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _removeEmojiReactions() { // fn#57245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4692, offset: 0x013e0abb, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57247).apply(this, arguments);
|
|
function* _fun57247(a0, a1, a2, a3) { // fn#57247, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4757, offset: 0x013e0af4, size: 262 bytes, params: 5, frame: 23
|
|
var environment;
|
|
if (true) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
var env0_2 = a2;
|
|
var env0_3;
|
|
value = a3 != null;
|
|
env0_3 = value && !!a3.isRetry;
|
|
value = environment.__proto__.__proto__;
|
|
var value3 = env2_1(env2_2[12]);
|
|
yield value3.unarchiveThreadIfNecessary(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var r9 = a2.id === null ? a2.name : '' + a2.name + ':' + a2.id;
|
|
var HTTP = env2_0(env2_2[11]).HTTP;
|
|
var del = HTTP.del;
|
|
var object = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
|
|
object.url = env2_10.REMOVE_EMOJI_REACTIONS(a0, a1, r9);
|
|
Reflect.apply(del, HTTP, [object]).catch(_fun57248);
|
|
}
|
|
function _fun57248(a0) { // fn#57248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:4993, offset: 0x013e0bfa, size: 42 bytes, params: 2, frame: 15
|
|
env3_12(a0, _fun57249, {isRetry: env0_3});
|
|
function _fun57249() { // fn#57249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5022, offset: 0x013e0c24, size: 42 bytes, params: 1, frame: 17
|
|
return env4_20(env1_0, require, importDefault, {isRetry: true});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _removeReaction() { // fn#57251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5181, offset: 0x013e0c4e, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57253).apply(this, arguments);
|
|
async function _fun57253({channelId, messageId, emoji, location = env2_11.MESSAGE, userId, options}) { // fn#57253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5234, offset: 0x013e0c90, size: 456 bytes, params: 2, frame: 30
|
|
var environment;
|
|
if (true) {
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = options != null;
|
|
var r10 = value && !!options.burst;
|
|
value = options != null;
|
|
var env0_7 = value && !!options.isRetry;
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_13;
|
|
binding('MESSAGE_REACTION_REMOVE', channelId, messageId, emoji, {userId: userId, burst: r10});
|
|
var value4 = env2_1(env2_2[12]);
|
|
await value4.unarchiveThreadIfNecessary(channelId);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var HTTP = env2_0(env2_2[11]).HTTP;
|
|
var del = HTTP.del;
|
|
object = {};
|
|
binding = env2_14;
|
|
var object2 = {channelId: channelId, messageId: messageId, emoji: emoji};
|
|
object2.userId = userId ?? '@me';
|
|
var ReactionTypes = env2_0(env2_2[10]).ReactionTypes;
|
|
object2.type = r10 ? ReactionTypes.BURST : ReactionTypes.NORMAL;
|
|
object2.useTypeEndpoint = true;
|
|
object.url = binding(object2);
|
|
object.query = {location: location, burst: r10};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
value = Reflect.apply(del, HTTP, [object]);
|
|
value = value.then(_fun57254);
|
|
value.catch(_fun57255());
|
|
}
|
|
function _fun57254() { // fn#57254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5728, offset: 0x013e0e58, size: 246 bytes, params: 1, frame: 18
|
|
var value2;
|
|
var binding;
|
|
var binding2;
|
|
var AccessibilityAnnouncer;
|
|
var announce;
|
|
var intl;
|
|
var value3;
|
|
var binding3;
|
|
if (options == null) {
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
AccessibilityAnnouncer = binding(binding2[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding2[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [intl.formatToPlainString(binding(binding2[7]).t['DQxi+7'],
|
|
{name: emoji.name})]);
|
|
} else if (options.burst) {
|
|
value3 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
AccessibilityAnnouncer = binding(binding3[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding3[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [intl.formatToPlainString(binding(binding3[7]).t['3l9f6u'],
|
|
{name: emoji.name})]);
|
|
} else {
|
|
value2 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
AccessibilityAnnouncer = binding(binding2[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding2[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [intl.formatToPlainString(binding(binding2[7]).t['DQxi+7'],
|
|
{name: emoji.name})]);
|
|
}
|
|
}
|
|
|
|
function _fun57255() { // fn#57255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5979, offset: 0x013e0f4e, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = env3_3(_fun57257);
|
|
return _fun57259;
|
|
function* _fun57257(a0) { // fn#57257, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:5999, offset: 0x013e0f77, size: 377 bytes, params: 2, frame: 24
|
|
var environment;
|
|
var value4;
|
|
var binding6;
|
|
var AccessibilityAnnouncer;
|
|
var announce;
|
|
var intl;
|
|
var binding7;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
|
|
var binding = env5_12;
|
|
var object = {};
|
|
object.isRetry = env2_7;
|
|
if (binding(a0, _fun57258, object)) {
|
|
binding = env5_24;
|
|
yield binding(env2_2, env2_6);
|
|
value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
binding = env5_13;
|
|
binding('MESSAGE_REACTION_ADD', env2_0, env2_1, env2_2, {userId: env2_4, burst: env2_6, colors: value4});
|
|
if (env2_5 == null) {
|
|
binding = env5_0;
|
|
binding6 = env5_2;
|
|
AccessibilityAnnouncer = binding(binding6[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding6[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer,
|
|
[intl.formatToPlainString(binding(binding6[7]).t['tD9+b+'],
|
|
{name: env2_2.name})]);
|
|
} else if (env2_5.burst) {
|
|
binding = env5_0;
|
|
binding7 = env5_2;
|
|
AccessibilityAnnouncer = binding(binding7[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding7[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [intl.formatToPlainString(binding(binding7[7]).t.OamVbV,
|
|
{name: env2_2.name})]);
|
|
} else {
|
|
binding = env5_0;
|
|
binding6 = env5_2;
|
|
AccessibilityAnnouncer = binding(binding6[15]).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = binding(binding6[7]).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer,
|
|
[intl.formatToPlainString(binding(binding6[7]).t['tD9+b+'],
|
|
{name: env2_2.name})]);
|
|
}
|
|
}
|
|
}
|
|
function _fun57258() { // fn#57258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6040, offset: 0x013e10f0, size: 84 bytes, params: 1, frame: 12
|
|
return env6_22({channelId: env3_0, messageId: env3_1, emoji: env3_2, location: env3_3, userId: env3_4,
|
|
options: {burst: env3_6, isRetry: true}});
|
|
}
|
|
|
|
}
|
|
|
|
function _fun57259() { // fn#57259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6522, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _getOptimisticEmojiColors() { // fn#57261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6701, offset: 0x013e1144, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun57263).apply(this, arguments);
|
|
function* _fun57263(a0, a1) { // fn#57263, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6774, offset: 0x013e117d, size: 82 bytes, params: 3, frame: 14
|
|
var r1;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var getEmojiColors;
|
|
var value3;
|
|
var error;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
const items2 = [];
|
|
if (a1) {
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
try {
|
|
property = binding2[17];
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
try {
|
|
value = binding(property);
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
try {
|
|
getEmojiColors = value.getEmojiColors;
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
try {
|
|
value = Reflect.apply(getEmojiColors, value, [a0]);
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
yield value;
|
|
try {
|
|
value = undefined;
|
|
value3 = false;
|
|
} catch (error) {
|
|
r1 = items2;
|
|
return r1;
|
|
}
|
|
if (value3) {
|
|
return value;
|
|
}
|
|
r1 = value;
|
|
return r1;
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
function hasUserAlreadyReacted(a0, a1, a2, a3) { // fn#57264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:6887, offset: 0x013e11cf, size: 56 bytes, params: 5, frame: 14
|
|
var r0;
|
|
var value;
|
|
const value2 = MessageStore.getMessage(a0, a1) != null;
|
|
if (value2) {
|
|
value = value.userHasReactedWithEmoji(a2, a3);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function playBurstReaction({channelId, messageId, emoji, key}) { // fn#57266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7329:7225, offset: 0x013e1207, size: 90 bytes, params: 2, frame: 17
|
|
Dispatcher.dispatch({type: 'BURST_REACTION_EFFECT_PLAY', channelId: channelId, messageId: messageId, emoji: emoji,
|
|
key: key});
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun57224, 7151, [5, 1226, 1379, 4814, 661, 672, 4647, 1244, 1239, 694, 7152, 507, 7153, 683, 4863, 4002,
|
|
7171, 3801,
|
|
2]) /* metro module 7151, dependencies: [5, 1226, 1379, 4814, 661, 672, 4647, 1244, 1239, 694, 7152, 507, 7153, 683, 4863, 4002, 7171, 3801, 2] */;
|