1505 lines
65 KiB
TypeScript
1505 lines
65 KiB
TypeScript
/* Metro module 4834; source: modules/conversations/ConversationsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 3793, 1934, 1878, 4835, 4836, 1393, 21, 4625, 3795, 566, 694, 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 SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import ConversationVisibilityStore from './ConversationVisibilityStore.tsx'; /* Metro dependency 4835 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as MessageRecordUtilsModule from '../messages/MessageRecordUtils.tsx'; /* Metro dependency 4625 */
|
|
import * as ConversationConstantsModule from './ConversationConstants.tsx'; /* Metro dependency 4836 */
|
|
|
|
function _fun42230(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:6, offset: 0x01133885, size: 818 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_42236 = 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 MESSAGE_REACTION_ADD_422422 = MESSAGE_REACTION_ADD_42242;
|
|
const dispose_422462 = dispose_42246;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConversationConstantsModule;
|
|
const env0_14 = value.CONVERSATION_COLORS;
|
|
const env0_15 = value.CONVERSATION_FEEDBACK_RATINGS_CACHE_MAX;
|
|
const MAX_CHANNELS_WITH_CONVERSATIONS = value.MAX_CHANNELS_WITH_CONVERSATIONS;
|
|
const env0_16 = value.MAX_CONVERSATIONS_PER_CHANNEL;
|
|
value = importDefault(1393) /* metro dependency 1393 */;
|
|
value = new value({max: MAX_CHANNELS_WITH_CONVERSATIONS, dispose: dispose_422462});
|
|
let Map = global.Map;
|
|
let map = new Map();
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const Store = (Flux).Store;
|
|
_fun42248(Store).displayName = 'ConversationsStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONVERSATION_FETCH_START: CONVERSATION_FETCH_START,
|
|
CONVERSATION_FETCH_SUCCESS: CONVERSATION_FETCH_SUCCESS_42269,
|
|
CONVERSATION_FETCH_FAILURE: CONVERSATION_FETCH_FAILURE, CONVERSATIONS_FETCH_START: CONVERSATIONS_FETCH_START,
|
|
CONVERSATIONS_FETCH_SUCCESS: CONVERSATIONS_FETCH_SUCCESS, CONVERSATIONS_FETCH_FAILURE: function({channelId,
|
|
requestKey}) {
|
|
return removePendingListFetch(channelId, requestKey);
|
|
}, CHANNEL_SELECT: CHANNEL_SELECT_42283, CHANNEL_DELETE: function({channel}) {
|
|
return evictChannel(channel.id);
|
|
}, GUILD_DELETE: GUILD_DELETE_42285, LOAD_MESSAGES_SUCCESS: LOAD_MESSAGES_SUCCESS_42286,
|
|
SET_SELECTED_CONVERSATION: SET_SELECTED_CONVERSATION,
|
|
CLEAR_CONVERSATION_SELECTION: CLEAR_CONVERSATION_SELECTION,
|
|
SET_CONVERSATION_FEEDBACK_RATING: SET_CONVERSATION_FEEDBACK_RATING, MESSAGE_UPDATE: MESSAGE_UPDATE_42290,
|
|
MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_422422, MESSAGE_REACTION_REMOVE: MESSAGE_REACTION_ADD_422422,
|
|
MESSAGE_REACTION_ADD_MANY: MESSAGE_REACTION_ADD_MANY_42292,
|
|
MESSAGE_REACTION_REMOVE_ALL: MESSAGE_REACTION_REMOVE_ALL_42294,
|
|
MESSAGE_REACTION_REMOVE_EMOJI: MESSAGE_REACTION_REMOVE_EMOJI_42296, MESSAGE_DELETE: function({channelId, id}) {
|
|
return removeHydratedMessage(channelId, id);
|
|
}, MESSAGE_DELETE_BULK: function({channelId, ids}) {
|
|
var r2;
|
|
var r3;
|
|
var r0;
|
|
var value5;
|
|
var value6;
|
|
var value2 = _createForOfIteratorHelperLoose_42234(ids);
|
|
var value3 = value2();
|
|
var value4 = false;
|
|
if (value3.done) {
|
|
r0 = value4;
|
|
} else {
|
|
r2 = value4;
|
|
r3 = value3;
|
|
while (true) {
|
|
if (removeHydratedMessage(channelId, r3.value)) {
|
|
value5 = true;
|
|
r2 = value5;
|
|
}
|
|
value6 = value2();
|
|
if (value6.done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}, LOGOUT: LOGOUT_42300});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/conversations/ConversationsStore.tsx');
|
|
exports.default = map;
|
|
function _isNativeReflectConstruct_42231() { // fn#42231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:375, offset: 0x01133bb7, 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_42231_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_42234(a0, a1) { // fn#42234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:568, offset: 0x01133c15, 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 _fun42235;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_42236(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_42236(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_42236(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun42235;
|
|
}
|
|
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 _fun42235() { // fn#42235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:1139, 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 removePendingListFetch(a0, a1) { // fn#42237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:1550, offset: 0x01133d87, size: 92 bytes, params: 3, frame: 14
|
|
var r0;
|
|
var size;
|
|
var value6;
|
|
const value2 = env0_18.get(a0);
|
|
const r3 = value2 == null || !value2.has(a1);
|
|
if (r3) {
|
|
r0 = !r3;
|
|
} else {
|
|
value2.delete(a1);
|
|
size = value2.size;
|
|
value6 = true;
|
|
if (size !== 0) {
|
|
r0 = value6;
|
|
} else {
|
|
env0_18.delete(a0);
|
|
r0 = value6;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function clearPendingConversationFetch(a0, a1) { // fn#42238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:1686, offset: 0x01133de3, size: 68 bytes, params: 3, frame: 13
|
|
const value2 = env0_19.get(a0);
|
|
if (value2 != null) {
|
|
value2.delete(a1);
|
|
if (value2.size === 0) {
|
|
env0_19.delete(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function buildModerationLabel(a0) { // fn#42239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:1792, offset: 0x01133e27, size: 329 bytes, params: 2, frame: 18
|
|
var r5;
|
|
const property = a0[0];
|
|
let value = a0.map(function(a0) {
|
|
return a0.category ?? a0.reason;
|
|
});
|
|
let filter = value.filter;
|
|
value = Reflect.apply(filter, value, [function(a0) {
|
|
return a0 != null;
|
|
}]);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const severity = value2 == property ? value3 : property.severity;
|
|
const r6 = value2 != severity ? severity : value2;
|
|
const confidence = value2 == property ? value3 : property.confidence;
|
|
const r8 = value2 != confidence ? confidence : value2;
|
|
let items2 = [value2 != r6 ? '' + r6 + ' severity' : value2];
|
|
items2[1] = value2 != r8 ? '' + r8 + ' confidence' : value2;
|
|
filter = items2.filter;
|
|
let Boolean = global.Boolean;
|
|
const value7 = Reflect.apply(filter, items2, [Boolean]).join(', ');
|
|
if (value.length > 0) {
|
|
value = value.join(', ');
|
|
r5 = value;
|
|
} else {
|
|
r5 = value2;
|
|
}
|
|
items2 = [r5];
|
|
items2[1] = value7.length > 0 ? value7 : value2;
|
|
filter = items2.filter;
|
|
Boolean = global.Boolean;
|
|
value = Reflect.apply(filter, items2, [Boolean]);
|
|
value = value.join(' · ');
|
|
return value.length > 0 ? value : 'Moderation Failed';
|
|
}
|
|
|
|
function MESSAGE_REACTION_ADD_42242(a0) { // fn#42242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:2225, offset: 0x01133f86, size: 324 bytes, params: 2, frame: 25
|
|
var r2;
|
|
var authenticationStoreBinding;
|
|
var conversationMetadataById;
|
|
var index;
|
|
const type = a0.type;
|
|
const channelId = a0.channelId;
|
|
const messageId = a0.messageId;
|
|
const userId = a0.userId;
|
|
const emoji = a0.emoji;
|
|
const reactionType = a0.reactionType;
|
|
var value;
|
|
const value2 = env0_17.peek(channelId);
|
|
if (value2 != null) {
|
|
var value3 = value2.messageMetadataByMessageId.get(messageId);
|
|
var value4 = undefined;
|
|
var message = value3 == null ? value4 : value3.message;
|
|
if (message == null) {
|
|
return false;
|
|
}
|
|
var moduleValue = require(3795) /* metro dependency 3795: ReactionUtils */;
|
|
if (moduleValue.shouldApplyReaction(a0)) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
value = authenticationStoreBinding.getId() === userId;
|
|
if (type === 'MESSAGE_REACTION_ADD') {
|
|
message = value3.message;
|
|
value = message.addReaction(emoji, value, a0.colors, reactionType);
|
|
r2 = value;
|
|
} else {
|
|
value = value3.message.removeReaction(emoji, value, reactionType);
|
|
r2 = value;
|
|
}
|
|
value3.message = r2;
|
|
conversationMetadataById = value2.conversationMetadataById;
|
|
value = conversationMetadataById.get(value3.conversationId);
|
|
if ((value == null ? value4 : value.hydratedMessages) != null) {
|
|
index = value.hydratedMessages.findIndex(function({id}) {
|
|
return id === messageId;
|
|
});
|
|
if (index !== -1) {
|
|
value.hydratedMessages[index] = r2;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function removeHydratedMessage(a0, a1) { // fn#42244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:2822, offset: 0x011340ca, size: 146 bytes, params: 3, frame: 15
|
|
var conversationMetadataById;
|
|
var value3;
|
|
const env0_0 = a1;
|
|
const value = env0_17.peek(a0);
|
|
if (value == null) {
|
|
return false;
|
|
}
|
|
const value2 = value.messageMetadataByMessageId.get(a1);
|
|
if (value2 != null) {
|
|
conversationMetadataById = value.conversationMetadataById;
|
|
value3 = conversationMetadataById.get(value2.conversationId);
|
|
if (value3?.hydratedMessages != null) {
|
|
value3.hydratedMessages = value3.hydratedMessages.filter(function({id}) {
|
|
return id !== require;
|
|
});
|
|
}
|
|
}
|
|
return value.messageMetadataByMessageId.delete(a1);
|
|
}
|
|
|
|
function dispose_42246(a0) { // fn#42246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3154, offset: 0x0113415c, size: 22 bytes, params: 2, frame: 11
|
|
return env0_18.delete(a0);
|
|
}
|
|
|
|
function evictChannel(a0) { // fn#42247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3209, offset: 0x01134172, size: 54 bytes, params: 2, frame: 13
|
|
const value2 = env0_17.has(a0);
|
|
env0_17.del(a0);
|
|
return value2 || dispose_42246(a0);
|
|
}
|
|
|
|
function _fun42248(a0) { // fn#42248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3309, offset: 0x011341a8, size: 466 bytes, params: 2, frame: 16
|
|
const ConversationsStore2 = ConversationsStore;
|
|
Inherits(ConversationsStore2, a0);
|
|
return CreateClass(ConversationsStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(AuthenticationStore, ChannelStore, ConversationVisibilityStore, RelationshipStore,
|
|
SelectedChannelStore, UserStore);
|
|
}}, {key: 'hasChannelData', value: value_42251}, {key: 'getChannelConversations', value: value_42252},
|
|
{key: 'getConversationForMessage', value: value_42254}, {key: 'getMessageMetadata', value: value_42255},
|
|
{key: 'getMessage', value: function(a0, a1) {
|
|
var r1;
|
|
var value = this.getMessageMetadata(a0, a1);
|
|
var value2 = null;
|
|
r1 = value2 == value ? undefined : value.message;
|
|
return value2 != r1 ? r1 : value2;
|
|
}}, {key: 'getConversationMetadata', value: value_42257}, {key: 'hasMoreConversations', value: value_42258},
|
|
{key: 'isPendingFetch', value: value_42259}, {key: 'isListFetchPending', value: value_42260},
|
|
{key: 'getSelectedConversationId', value: value_42261}, {key: 'getSelectedConversation', value: value_42262},
|
|
{key: 'getSelectedConversationColor', value: value_42263}, {key: 'getHydratedMessages', value: value_42264},
|
|
{key: 'getHydratedMessageById', value: value_42265}, {key: 'isConversationFetchPending', value: value_42266},
|
|
{key: 'getConversationFeedbackRating', value: value_42267}]);
|
|
function ConversationsStore() { // fn#42249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3321, offset: 0x01121ae9, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_3(this, ConversationsStore);
|
|
const value3 = env1_6(ConversationsStore);
|
|
return env1_5(this, _isNativeReflectConstruct_42231() ? global.Reflect.construct(value3, arguments,
|
|
env1_6(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_42251(a0) { // fn#42251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3696, offset: 0x00fc0a0f, size: 22 bytes, params: 2, frame: 11
|
|
return env1_17.has(a0);
|
|
}
|
|
|
|
function value_42252(a0) { // fn#42252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3763, offset: 0x011343a9, size: 59 bytes, params: 2, frame: 12
|
|
var environment;
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r0 = value2;
|
|
} else {
|
|
value = value.conversations.map(_fun42253);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun42253(a0) { // fn#42253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3832, offset: 0x011343e4, size: 77 bytes, params: 2, frame: 13
|
|
return {conversation: a0, color: env0_0.conversationMetadataById.get(a0.id)?.color ?? CONVERSATION_COLORS[0]};
|
|
}
|
|
|
|
}
|
|
|
|
function value_42254(a0, a1) { // fn#42254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:3994, offset: 0x01134431, size: 80 bytes, params: 3, frame: 14
|
|
var conversationId;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
if (value2 == value) {
|
|
conversationId = value3;
|
|
} else {
|
|
value = value.messageMetadataByMessageId.get(a1);
|
|
conversationId = value2 == value ? value3 : value.conversationId;
|
|
}
|
|
return value2 != conversationId ? conversationId : value2;
|
|
}
|
|
|
|
function value_42255(a0, a1) { // fn#42255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4165, offset: 0x01134481, size: 65 bytes, params: 3, frame: 13
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.messageMetadataByMessageId.get(a1);
|
|
r1 = value;
|
|
}
|
|
return value2 != r1 ? r1 : value2;
|
|
}
|
|
|
|
function value_42257(a0, a1) { // fn#42257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4441, offset: 0x011344f7, size: 65 bytes, params: 3, frame: 13
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.conversationMetadataById.get(a1);
|
|
r1 = value;
|
|
}
|
|
return value2 != r1 ? r1 : value2;
|
|
}
|
|
|
|
function value_42258(a0, a1) { // fn#42258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4584, offset: 0x01134538, size: 66 bytes, params: 3, frame: 12
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
return value != null && (a1 === 'before' ? !value.reachedOldest : !value.reachedNewest);
|
|
}
|
|
|
|
function value_42259(a0) { // fn#42259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4709, offset: 0x0113457a, size: 22 bytes, params: 2, frame: 11
|
|
return env1_18.has(a0);
|
|
}
|
|
|
|
function value_42260(a0, a1) { // fn#42260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4771, offset: 0x01134590, size: 56 bytes, params: 3, frame: 13
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = env1_18.get(a0);
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.has(a1);
|
|
r1 = value;
|
|
}
|
|
return r1 != null && r1;
|
|
}
|
|
|
|
function value_42261(a0) { // fn#42261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:4889, offset: 0x011345c8, size: 52 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const selectedConversationId = value2 == value ? undefined : value.selectedConversationId;
|
|
return value2 != selectedConversationId ? selectedConversationId : value2;
|
|
}
|
|
|
|
function value_42262(a0) { // fn#42262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5024, offset: 0x011345fc, size: 104 bytes, params: 2, frame: 15
|
|
var conversation;
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const selectedConversationId = value2 == value ? value3 : value.selectedConversationId;
|
|
if (value2 == selectedConversationId) {
|
|
r0 = value2;
|
|
} else {
|
|
if (value2 == value) {
|
|
conversation = value3;
|
|
} else {
|
|
value = value.conversationMetadataById.get(selectedConversationId);
|
|
conversation = value2 == value ? value3 : value.conversation;
|
|
}
|
|
r0 = value2 != conversation ? conversation : value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_42263(a0) { // fn#42263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5254, offset: 0x01134664, size: 103 bytes, params: 2, frame: 15
|
|
var color;
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const selectedConversationId = value2 == value ? value3 : value.selectedConversationId;
|
|
if (value2 == selectedConversationId) {
|
|
r0 = value2;
|
|
} else {
|
|
if (value2 == value) {
|
|
color = value3;
|
|
} else {
|
|
value = value.conversationMetadataById.get(selectedConversationId);
|
|
color = value2 == value ? value3 : value.color;
|
|
}
|
|
r0 = value2 != color ? color : value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_42264(a0, a1) { // fn#42264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5468, offset: 0x011346cb, size: 80 bytes, params: 3, frame: 14
|
|
var hydratedMessages;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
if (value2 == value) {
|
|
hydratedMessages = value3;
|
|
} else {
|
|
value = value.conversationMetadataById.get(a1);
|
|
hydratedMessages = value2 == value ? value3 : value.hydratedMessages;
|
|
}
|
|
return value2 != hydratedMessages ? hydratedMessages : value2;
|
|
}
|
|
|
|
function value_42265(a0, a1) { // fn#42265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5643, offset: 0x0113471b, size: 79 bytes, params: 3, frame: 14
|
|
var message;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
if (value2 == value) {
|
|
message = value3;
|
|
} else {
|
|
value = value.messageMetadataByMessageId.get(a1);
|
|
message = value2 == value ? value3 : value.message;
|
|
}
|
|
return value2 != message ? message : value2;
|
|
}
|
|
|
|
function value_42266(a0, a1) { // fn#42266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5815, offset: 0x0113476a, size: 74 bytes, params: 3, frame: 13
|
|
var r1;
|
|
var value4;
|
|
let value = environment.__proto__;
|
|
value = env1_19.get(a0);
|
|
let r0 = value != null && value.size !== 0;
|
|
if (r0) {
|
|
value4 = a1 !== true;
|
|
if (value4) {
|
|
r1 = value4;
|
|
} else {
|
|
value = value.has('full');
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_42267(a0, a1) { // fn#42267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:5941, offset: 0x011347b4, size: 65 bytes, params: 3, frame: 13
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = env1_17.peek(a0);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.recentFeedbackRatingsByConversationId.get(a1);
|
|
r1 = value;
|
|
}
|
|
return value2 != r1 ? r1 : value2;
|
|
}
|
|
|
|
}
|
|
|
|
function CONVERSATION_FETCH_START({conversationId, full}) { // fn#42268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:6166, offset: 0x011347f5, size: 119 bytes, params: 2, frame: 17
|
|
var set;
|
|
var Set;
|
|
var items;
|
|
const r2 = full ? 'full' : 'preview';
|
|
let binding = env0_19;
|
|
const value2 = binding.get(conversationId);
|
|
if (value2 != null) {
|
|
value2.add(r2);
|
|
} else {
|
|
binding = env0_19;
|
|
set = binding.set;
|
|
Set = global.Set;
|
|
items = [r2];
|
|
Reflect.apply(set, binding, [conversationId, new Set()]);
|
|
}
|
|
}
|
|
|
|
function CONVERSATION_FETCH_SUCCESS_42269({channelId, conversationId, messages, fullyHydrated}) { // fn#42269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:6379, offset: 0x0113486c, size: 257 bytes, params: 2, frame: 25
|
|
var environment;
|
|
var r1;
|
|
var r5;
|
|
var value3;
|
|
var conversationMetadataById;
|
|
var get;
|
|
var value5;
|
|
var fullyHydrated2;
|
|
var map;
|
|
var value6;
|
|
var value7;
|
|
var done;
|
|
var value8;
|
|
var messageMetadataByMessageId;
|
|
var id;
|
|
var value9;
|
|
var set;
|
|
var value10;
|
|
let value = environment;
|
|
const clearPendingConversationFetchBinding = clearPendingConversationFetch;
|
|
reducibleJoin2: while (true) {
|
|
if (fullyHydrated) {
|
|
value3 = 'full';
|
|
r1 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
r1 = 'preview';
|
|
break reducibleJoin2;
|
|
}
|
|
clearPendingConversationFetchBinding(conversationId, r1);
|
|
const value4 = env0_17.peek(channelId);
|
|
reducibleJoin12: while (true) {
|
|
if (value4 == null) {
|
|
break reducibleJoin12;
|
|
}
|
|
conversationMetadataById = value4.conversationMetadataById;
|
|
get = conversationMetadataById.get;
|
|
value5 = Reflect.apply(get, conversationMetadataById, [conversationId]);
|
|
if (value5 == null) {
|
|
break reducibleJoin12;
|
|
}
|
|
if (!fullyHydrated) {
|
|
fullyHydrated2 = value5.fullyHydrated;
|
|
if (fullyHydrated2) {
|
|
break reducibleJoin12;
|
|
}
|
|
}
|
|
map = messages.map;
|
|
value6 = Reflect.apply(map, messages, [_fun42270]);
|
|
value = _createForOfIteratorHelperLoose_42234(value6);
|
|
value7 = value();
|
|
done = value7.done;
|
|
if (!done) {
|
|
r5 = value7;
|
|
reducibleLoop7: while (true) {
|
|
value8 = r5.value;
|
|
messageMetadataByMessageId = value4.messageMetadataByMessageId;
|
|
get = messageMetadataByMessageId.get;
|
|
id = value8.id;
|
|
value9 = Reflect.apply(get, messageMetadataByMessageId, [id]);
|
|
if (value9 != null) {
|
|
value9.message = value8;
|
|
} else {
|
|
messageMetadataByMessageId = value4.messageMetadataByMessageId;
|
|
set = messageMetadataByMessageId.set;
|
|
id = value8.id;
|
|
Reflect.apply(set, messageMetadataByMessageId, [id, {conversationId: conversationId,
|
|
moderationLabel: null,
|
|
message: value8}]);
|
|
}
|
|
value10 = value();
|
|
done = value10.done;
|
|
if (done) {
|
|
break reducibleLoop7;
|
|
}
|
|
r5 = value10;
|
|
continue reducibleLoop7;
|
|
}
|
|
}
|
|
value5.hydratedMessages = value6;
|
|
value5.fullyHydrated = fullyHydrated;
|
|
break reducibleJoin12;
|
|
}
|
|
function _fun42270(a0) { // fn#42270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:6652, offset: 0x0113496d, size: 41 bytes, params: 2, frame: 11
|
|
const value = environment.__proto__;
|
|
return (MessageRecordUtilsModule).createMessageRecord(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function CONVERSATION_FETCH_FAILURE({conversationId, full}) { // fn#42271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:6977, offset: 0x01134996, size: 43 bytes, params: 2, frame: 13
|
|
clearPendingConversationFetch(conversationId, full ? 'full' : 'preview');
|
|
}
|
|
|
|
function CONVERSATIONS_FETCH_START(a0) { // fn#42272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:7123, offset: 0x011349c1, size: 123 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var set;
|
|
const channelId = a0.channelId;
|
|
const requestKey = a0.requestKey;
|
|
if (a0.isJump) {
|
|
env0_18.delete(channelId);
|
|
}
|
|
const value2 = env0_18.get(channelId);
|
|
if (value2 != null) {
|
|
r1 = value2;
|
|
} else {
|
|
set = new global.Set();
|
|
env0_18.set(channelId, set);
|
|
r1 = set;
|
|
}
|
|
r1.add(requestKey);
|
|
}
|
|
|
|
function CONVERSATIONS_FETCH_SUCCESS({channelId, conversations, direction, anchor, isJump, requestKey}) { // fn#42273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:7326, offset: 0x01134a3c, size: 621 bytes, params: 2, frame: 29
|
|
var r7;
|
|
var selectedConversationId;
|
|
var conversation;
|
|
var r11;
|
|
var r6;
|
|
var r16;
|
|
var r13;
|
|
var r10;
|
|
var r12;
|
|
var r14;
|
|
var r8;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var Set;
|
|
var value10;
|
|
var set;
|
|
var value15;
|
|
var value16;
|
|
var value17;
|
|
var value21;
|
|
var value22;
|
|
var value24;
|
|
var value25;
|
|
let value = undefined;
|
|
if (removePendingListFetch(channelId, requestKey)) {
|
|
value3 = env0_17.peek(channelId);
|
|
value4 = null;
|
|
value5 = value4 == value3;
|
|
if (isJump) {
|
|
selectedConversationId = value5 ? value : value3.selectedConversationId;
|
|
if (value4 != selectedConversationId) {
|
|
if (value4 == value3) {
|
|
conversation = value;
|
|
} else {
|
|
value6 = value3.conversationMetadataById.get(selectedConversationId);
|
|
conversation = value4 == value6 ? value : value6.conversation;
|
|
}
|
|
r11 = conversation;
|
|
} else {
|
|
r11 = value4;
|
|
}
|
|
r7 = value4 != r11 ? [r11] : [];
|
|
} else {
|
|
conversations = value5 ? value : value3.conversations;
|
|
r7 = value4 != conversations ? conversations : [];
|
|
}
|
|
value7 = !isJump;
|
|
r16 = isJump ? value7 : value4 != (value4 == value3 ? value : value3.reachedOldest) && (value4 == value3 ? value : value3.reachedOldest);
|
|
r13 = isJump ? value7 : value4 != (value4 == value3 ? value : value3.reachedNewest) && (value4 == value3 ? value : value3.reachedNewest);
|
|
Set = global.Set;
|
|
value10 = r7.map(function(a0) {
|
|
return a0.id;
|
|
});
|
|
set = new Set();
|
|
r6 = conversations.some(_fun42275) || value4 == anchor;
|
|
if (r6) {
|
|
r10 = r13;
|
|
r12 = r16;
|
|
} else {
|
|
value15 = true;
|
|
if (direction === 'before') {
|
|
r6 = r13;
|
|
r11 = value15;
|
|
} else {
|
|
r13 = direction === 'after' ? value15 : r13;
|
|
r6 = r13;
|
|
r11 = r16;
|
|
}
|
|
r10 = r6;
|
|
r12 = r11;
|
|
}
|
|
value16 = mergeConversations(r7, conversations);
|
|
if (value16.length > MAX_CONVERSATIONS_PER_CHANNEL) {
|
|
if (direction === 'after') {
|
|
value24 = value16.slice(value16.length - MAX_CONVERSATIONS_PER_CHANNEL);
|
|
value25 = false;
|
|
r6 = r10;
|
|
r7 = value25;
|
|
r8 = value24;
|
|
} else if (direction === 'before') {
|
|
value22 = value16.slice(0, MAX_CONVERSATIONS_PER_CHANNEL);
|
|
r6 = false;
|
|
r7 = r12;
|
|
r8 = value22;
|
|
} else {
|
|
value17 = clampAnchorWindowStart(value16, anchor);
|
|
r14 = !(value17 > 0) && r12;
|
|
r11 = !(value17 + MAX_CONVERSATIONS_PER_CHANNEL < value16.length) && r10;
|
|
value21 = value16.slice(value17, value17 + MAX_CONVERSATIONS_PER_CHANNEL);
|
|
r6 = r11;
|
|
r7 = r14;
|
|
r8 = value21;
|
|
}
|
|
} else {
|
|
r6 = r10;
|
|
r7 = r12;
|
|
r8 = value16;
|
|
}
|
|
value = buildChannelData(channelId, r8, value3);
|
|
value.reachedOldest = r7;
|
|
value.reachedNewest = r6;
|
|
if (value4 != value3) {
|
|
global.Object.assign(value3, value);
|
|
} else {
|
|
env0_17.set(channelId, value);
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
function _fun42275({id}) { // fn#42275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:7862, offset: 0x011289b2, size: 30 bytes, params: 2, frame: 11
|
|
const binding = env0_0;
|
|
return !binding.has(id);
|
|
}
|
|
|
|
function mergeConversations(a0, a1) { // fn#42276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:7933, owner: CONVERSATIONS_FETCH_SUCCESS.mergeConversations, offset: 0x01134ca9, size: 198 bytes, params: 3, frame: 18
|
|
var r4;
|
|
var r2;
|
|
var value5;
|
|
var set;
|
|
var id;
|
|
var value6;
|
|
var value9;
|
|
var value10;
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
const value3 = _createForOfIteratorHelperLoose_42234(a0);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
for (r4 = value4; true; r4 = value6) {
|
|
value5 = r4.value;
|
|
set = map.set;
|
|
id = value5.id;
|
|
Reflect.apply(set, map, [id, value5]);
|
|
value6 = value3();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
const value7 = _createForOfIteratorHelperLoose_42234(a1);
|
|
const value8 = value7();
|
|
done = value8.done;
|
|
if (!done) {
|
|
for (r2 = value8; true; r2 = value10) {
|
|
value9 = r2.value;
|
|
set = map.set;
|
|
id = value9.id;
|
|
Reflect.apply(set, map, [id, value9]);
|
|
value10 = value7();
|
|
done = value10.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
const Array = global.Array;
|
|
map = Array.from(map.values());
|
|
map.sort(_fun42277);
|
|
return map;
|
|
function _fun42277({startMessageId}, {startMessageId}) { // fn#42277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:8202, offset: 0x01134d6f, size: 57 bytes, params: 3, frame: 13
|
|
const value = environment.__proto__.__proto__;
|
|
return (SnowflakeUtils).compare(startMessageId, startMessageId);
|
|
}
|
|
|
|
}
|
|
|
|
function clampAnchorWindowStart(a0, a1) { // fn#42278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:8376, owner: CONVERSATIONS_FETCH_SUCCESS.clampAnchorWindowStart, offset: 0x01134da8, size: 137 bytes, params: 3, frame: 16
|
|
var environment;
|
|
const env0_0 = a1;
|
|
if (a1 == null) {
|
|
return 0;
|
|
}
|
|
let value = a0.findIndex(_fun42279);
|
|
const r6 = value !== -1 ? value : a0.length;
|
|
let Math = global.Math;
|
|
const floor = Math.floor;
|
|
value = environment.__proto__;
|
|
value = Reflect.apply(floor, Math, [MAX_CONVERSATIONS_PER_CHANNEL / 2]);
|
|
const value2 = a0.length - MAX_CONVERSATIONS_PER_CHANNEL;
|
|
Math = global.Math;
|
|
const max = Math.max;
|
|
const Math2 = global.Math;
|
|
value = Math2.min(r6 - value, value2);
|
|
return Reflect.apply(max, Math, [0, value]);
|
|
function _fun42279({startMessageId}) { // fn#42279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:8452, offset: 0x01134e31, size: 61 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(startMessageId, require);
|
|
return value >= 0;
|
|
}
|
|
|
|
}
|
|
|
|
function buildChannelData(a0, a1, a2) { // fn#42280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:8651, owner: CONVERSATIONS_FETCH_SUCCESS.buildChannelData, offset: 0x01134e6e, size: 1133 bytes, params: 4, frame: 50
|
|
var environment;
|
|
var r0;
|
|
var r20;
|
|
var r21;
|
|
var r25;
|
|
var color;
|
|
var r24;
|
|
var r29;
|
|
var hydratedMessages;
|
|
var r28;
|
|
var r27;
|
|
var r31;
|
|
var r33;
|
|
var message;
|
|
var r39;
|
|
var r6;
|
|
var property;
|
|
var value3;
|
|
var channel;
|
|
var value13;
|
|
var conversationMetadataById;
|
|
var get;
|
|
var id;
|
|
var value14;
|
|
var value15;
|
|
var value16;
|
|
var length;
|
|
var value17;
|
|
var value18;
|
|
var fullyHydrated;
|
|
var value19;
|
|
var value20;
|
|
var set;
|
|
var moderation;
|
|
var value21;
|
|
var value22;
|
|
var flaggedMessageDetails;
|
|
var value23;
|
|
var value24;
|
|
var value25;
|
|
var messageId;
|
|
var value26;
|
|
var value27;
|
|
var messageIds;
|
|
var value28;
|
|
var value29;
|
|
var value30;
|
|
var value31;
|
|
var flaggedMessageIds;
|
|
var value32;
|
|
var value33;
|
|
var buildModerationLabelBinding;
|
|
var value34;
|
|
var moderationLabel;
|
|
var messageMetadataByMessageId;
|
|
var value35;
|
|
var value36;
|
|
var value37;
|
|
var defaultImport;
|
|
var value39;
|
|
let value = null;
|
|
const value2 = undefined;
|
|
const guildId = value == a2 ? value2 : a2.guildId;
|
|
if (value != guildId) {
|
|
r0 = guildId;
|
|
} else {
|
|
property = a1[0];
|
|
r0 = value == property ? value2 : property.guildId;
|
|
}
|
|
if (value == r0) {
|
|
value3 = environment.__proto__;
|
|
channel = ChannelStore.getChannel(a0);
|
|
r0 = value == channel ? value2 : channel.guild_id;
|
|
}
|
|
const r10 = value != r0 ? r0 : value;
|
|
let Map = global.Map;
|
|
let prototype = Map.prototype;
|
|
const value5 = Object.create(prototype, {constructor: {value: Map}});
|
|
let map = new Map();
|
|
const value6 = map instanceof Object ? map : value5;
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const colorIndex = value == a2 ? value2 : a2.colorIndex;
|
|
let r1 = value != colorIndex ? colorIndex : 0;
|
|
const value11 = _createForOfIteratorHelperLoose_42234(a1);
|
|
const value12 = value11();
|
|
let done = value12.done;
|
|
if (!done) {
|
|
r20 = r1;
|
|
r21 = value12;
|
|
while (true) {
|
|
value13 = r21.value;
|
|
if (value == a2) {
|
|
r25 = value2;
|
|
} else {
|
|
conversationMetadataById = a2.conversationMetadataById;
|
|
value14 = conversationMetadataById.get(value13.id);
|
|
r25 = value14;
|
|
}
|
|
if (value == r25) {
|
|
color = value2;
|
|
continue;
|
|
}
|
|
color = r25.color;
|
|
if (value != color) {
|
|
r24 = r20;
|
|
r29 = color;
|
|
continue;
|
|
}
|
|
value15 = typeof r20 === 'bigint' ? r20 : +r20;
|
|
value16 = typeof value15 === 'bigint' ? value15 + 1n : +value15 + 1;
|
|
length = CONVERSATION_COLORS.length;
|
|
property = CONVERSATION_COLORS[value15 % length];
|
|
r24 = value16;
|
|
r29 = property;
|
|
if (value == r25) {
|
|
hydratedMessages = value2;
|
|
continue;
|
|
}
|
|
hydratedMessages = r25.hydratedMessages;
|
|
if (value != hydratedMessages) {
|
|
r28 = hydratedMessages;
|
|
continue;
|
|
}
|
|
r28 = value;
|
|
continue;
|
|
value17 = value != r28;
|
|
if (!value17) {
|
|
r27 = value17;
|
|
continue;
|
|
}
|
|
value18 = value == r25;
|
|
if (value18) {
|
|
r0 = value18;
|
|
continue;
|
|
}
|
|
fullyHydrated = r25.fullyHydrated;
|
|
value19 = !fullyHydrated;
|
|
r0 = value19;
|
|
value20 = !r0;
|
|
r27 = value20;
|
|
set = value6.set;
|
|
id = value13.id;
|
|
Reflect.apply(set, value6, [id, {conversation: value13, color: r29, hydratedMessages: r28,
|
|
fullyHydrated: r27}]);
|
|
moderation = value13.moderation;
|
|
if (value == moderation) {
|
|
r31 = value;
|
|
continue;
|
|
}
|
|
Map = global.Map;
|
|
prototype = Map.prototype;
|
|
value21 = Object.create(prototype, {constructor: {value: Map}});
|
|
map = new Map();
|
|
value22 = map instanceof Object ? map : value21;
|
|
_createForOfIteratorHelperLoose_42234Binding = _createForOfIteratorHelperLoose_42234;
|
|
moderation = value13.moderation;
|
|
flaggedMessageDetails = moderation.flaggedMessageDetails;
|
|
value23 = _createForOfIteratorHelperLoose_42234Binding(flaggedMessageDetails);
|
|
value24 = value23();
|
|
done = value24.done;
|
|
if (done) {
|
|
r31 = value22;
|
|
continue;
|
|
}
|
|
r27 = value24;
|
|
while (true) {
|
|
value25 = r27.value;
|
|
get = value22.get;
|
|
messageId = value25.messageId;
|
|
value26 = Reflect.apply(get, value22, [messageId]);
|
|
if (value != value26) {
|
|
value26.push(value25);
|
|
} else {
|
|
set = value22.set;
|
|
messageId = value25.messageId;
|
|
Reflect.apply(set, value22, [messageId, [value25]]);
|
|
}
|
|
value27 = value23();
|
|
done = value27.done;
|
|
if (done) {
|
|
r31 = value22;
|
|
break;
|
|
}
|
|
r27 = value27;
|
|
continue;
|
|
}
|
|
_createForOfIteratorHelperLoose_42234Binding = _createForOfIteratorHelperLoose_42234;
|
|
messageIds = value13.messageIds;
|
|
value28 = _createForOfIteratorHelperLoose_42234Binding(messageIds);
|
|
value29 = value28();
|
|
done = value29.done;
|
|
if (done) {
|
|
continue;
|
|
}
|
|
r29 = value29;
|
|
while (true) {
|
|
value30 = r29.value;
|
|
moderation = value13.moderation;
|
|
value31 = value != moderation;
|
|
if (value31) {
|
|
moderation = value13.moderation;
|
|
flaggedMessageIds = moderation.flaggedMessageIds;
|
|
value32 = flaggedMessageIds.includes(value30);
|
|
r0 = value32;
|
|
} else {
|
|
r0 = value31;
|
|
}
|
|
if (!r0) {
|
|
continue;
|
|
}
|
|
value33 = value != r31;
|
|
r0 = value33;
|
|
if (!r0) {
|
|
r33 = value;
|
|
continue;
|
|
}
|
|
buildModerationLabelBinding = buildModerationLabel;
|
|
value34 = r31.get(value30);
|
|
if (value != value34) {
|
|
r0 = value34;
|
|
continue;
|
|
}
|
|
moderationLabel = buildModerationLabelBinding([]);
|
|
r33 = moderationLabel;
|
|
if (value == a2) {
|
|
message = value2;
|
|
continue;
|
|
}
|
|
messageMetadataByMessageId = a2.messageMetadataByMessageId;
|
|
value35 = messageMetadataByMessageId.get(value30);
|
|
if (value == value35) {
|
|
message = value2;
|
|
continue;
|
|
}
|
|
message = value35.message;
|
|
if (value != message) {
|
|
r39 = message;
|
|
continue;
|
|
}
|
|
r39 = value;
|
|
continue;
|
|
set = map.set;
|
|
id = value13.id;
|
|
Reflect.apply(set, map, [value30, {conversationId: id, moderationLabel: r33, message: r39}]);
|
|
value36 = value28();
|
|
done = value36.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r29 = value36;
|
|
continue;
|
|
}
|
|
value37 = value11();
|
|
done = value37.done;
|
|
if (done) {
|
|
r1 = r24;
|
|
break;
|
|
}
|
|
r20 = r24;
|
|
r21 = value37;
|
|
continue;
|
|
}
|
|
}
|
|
const recentFeedbackRatingsByConversationId = value == a2 ? value2 : a2.recentFeedbackRatingsByConversationId;
|
|
if (value != recentFeedbackRatingsByConversationId) {
|
|
r6 = recentFeedbackRatingsByConversationId;
|
|
} else {
|
|
defaultImport = importDefault(1393) /* metro dependency 1393 */;
|
|
({}).max = CONVERSATION_FEEDBACK_RATINGS_CACHE_MAX;
|
|
value39 = new defaultImport();
|
|
}
|
|
const selectedConversationId = value == a2 ? value2 : a2.selectedConversationId;
|
|
r0 = value != selectedConversationId ? selectedConversationId : value;
|
|
const r2 = value != r0 && a1.some(_fun42281) ? r0 : value;
|
|
const reachedOldest = value == a2 ? value2 : a2.reachedOldest;
|
|
const value41 = value != reachedOldest;
|
|
const reachedNewest = value == a2 ? value2 : a2.reachedNewest;
|
|
value = value != reachedNewest;
|
|
return {guildId: r10, conversations: a1, conversationMetadataById: value6, messageMetadataByMessageId: map,
|
|
recentFeedbackRatingsByConversationId: r6, reachedOldest: value41 && reachedOldest,
|
|
reachedNewest: value && reachedNewest, selectedConversationId: r2, colorIndex: r1};
|
|
function _fun42281({id}) { // fn#42281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:10036, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
|
|
return id === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function CHANNEL_SELECT_42283({channelId}) { // fn#42283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:10569, offset: 0x011352fa, size: 58 bytes, params: 2, frame: 12
|
|
if (channelId != null && env0_17.has(channelId)) {
|
|
env0_17.get(channelId);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function GUILD_DELETE_42285({guild}) { // fn#42285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:10749, offset: 0x01135351, size: 166 bytes, params: 2, frame: 21
|
|
var r2;
|
|
var r3;
|
|
var guildId;
|
|
var r1;
|
|
var r0;
|
|
var value7;
|
|
var peek;
|
|
var value8;
|
|
var id;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
if ('unavailable' in guild) {
|
|
reducibleJoin2: while (true) {
|
|
if (guild.unavailable === true) {
|
|
return false;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
}
|
|
const _createForOfIteratorHelperLoose_42234Binding = _createForOfIteratorHelperLoose_42234;
|
|
let binding = env0_17;
|
|
const value4 = _createForOfIteratorHelperLoose_42234Binding(binding.keys());
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (done) {
|
|
r0 = false;
|
|
} else {
|
|
r2 = false;
|
|
r3 = value5;
|
|
reducibleLoop3: while (true) {
|
|
value7 = r3.value;
|
|
binding = env0_17;
|
|
peek = binding.peek;
|
|
value8 = Reflect.apply(peek, binding, [value7]);
|
|
reducibleJoin5: while (true) {
|
|
if (value8 == null) {
|
|
guildId = undefined;
|
|
break reducibleJoin5;
|
|
}
|
|
guildId = value8.guildId;
|
|
break reducibleJoin5;
|
|
}
|
|
id = guild.id;
|
|
value9 = guildId === id;
|
|
reducibleJoin7: while (true) {
|
|
if (value9) {
|
|
value10 = evictChannel(value7);
|
|
r1 = value10;
|
|
break reducibleJoin7;
|
|
}
|
|
r1 = value9;
|
|
break reducibleJoin7;
|
|
}
|
|
reducibleJoin9: while (true) {
|
|
if (r1) {
|
|
value11 = true;
|
|
r2 = value11;
|
|
break reducibleJoin9;
|
|
}
|
|
break reducibleJoin9;
|
|
}
|
|
value12 = value4();
|
|
done = value12.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break reducibleLoop3;
|
|
}
|
|
r3 = value12;
|
|
continue reducibleLoop3;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function LOAD_MESSAGES_SUCCESS_42286({channelId, jump}) { // fn#42286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:11031, offset: 0x011353f7, size: 85 bytes, params: 2, frame: 13
|
|
var r0;
|
|
if (jump == null) {
|
|
return false;
|
|
}
|
|
const selectedChannelStoreBinding = SelectedChannelStore;
|
|
const getChannelId = selectedChannelStoreBinding.getChannelId;
|
|
if (Reflect.apply(getChannelId, selectedChannelStoreBinding, []) !== channelId) {
|
|
return false;
|
|
}
|
|
let value = env0_17.peek(channelId);
|
|
const value2 = value != null;
|
|
if (value2) {
|
|
value.reachedOldest = false;
|
|
value.reachedNewest = false;
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function SET_SELECTED_CONVERSATION({channelId, conversationId}) { // fn#42287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:11232, offset: 0x0113544c, size: 59 bytes, params: 2, frame: 13
|
|
var r0;
|
|
if (channelId == null) {
|
|
return false;
|
|
}
|
|
let value = env0_17.peek(channelId);
|
|
const value2 = value != null;
|
|
if (value2) {
|
|
value.selectedConversationId = conversationId;
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function CLEAR_CONVERSATION_SELECTION({channelId, conversationId}) { // fn#42288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:11417, offset: 0x01135487, size: 82 bytes, params: 2, frame: 15
|
|
let value = env0_17.peek(channelId);
|
|
if (value == null) {
|
|
return false;
|
|
}
|
|
const selectedConversationId = value.selectedConversationId;
|
|
let r0 = selectedConversationId != null && (conversationId == null || selectedConversationId === conversationId);
|
|
if (r0) {
|
|
value.selectedConversationId = null;
|
|
value = true;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function SET_CONVERSATION_FEEDBACK_RATING({channelId, conversationId, rating}) { // fn#42289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:11661, offset: 0x011354d9, size: 68 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = env0_17.peek(channelId);
|
|
const value2 = value != null;
|
|
if (value2) {
|
|
value.recentFeedbackRatingsByConversationId.set(conversationId, rating);
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MESSAGE_UPDATE_42290({message}) { // fn#42290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:11849, offset: 0x0113551d, size: 253 bytes, params: 2, frame: 19
|
|
var index;
|
|
const channel_id = message.channel_id;
|
|
const id = message.id;
|
|
if (channel_id == null) {
|
|
return false;
|
|
}
|
|
if (id == null) {
|
|
return false;
|
|
}
|
|
const value2 = env0_17.peek(channel_id);
|
|
const r5 = value2 == null ? undefined : value2.messageMetadataByMessageId.get(id);
|
|
var message = r5?.message;
|
|
if (message == null) {
|
|
return false;
|
|
}
|
|
let value = MessageRecordUtilsModule;
|
|
const updateMessageRecord = value.updateMessageRecord;
|
|
message = r5.message;
|
|
value = Reflect.apply(updateMessageRecord, value, [message, message]);
|
|
r5.message = value;
|
|
const r0 = value2 == null ? undefined : value2.conversationMetadataById.get(r5.conversationId);
|
|
if (r0?.hydratedMessages != null) {
|
|
index = r0.hydratedMessages.findIndex(function({id}) {
|
|
return id === id;
|
|
});
|
|
if (index !== -1) {
|
|
r0.hydratedMessages[index] = value;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function MESSAGE_REACTION_ADD_MANY_42292({channelId, messageId, reactions}) { // fn#42292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:12433, offset: 0x0113561a, size: 221 bytes, params: 2, frame: 19
|
|
var index;
|
|
const value2 = env0_17.peek(channelId);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
const value3 = value2.messageMetadataByMessageId.get(messageId);
|
|
let message = value3?.message;
|
|
if (message == null) {
|
|
return false;
|
|
}
|
|
message = value3.message;
|
|
const addReactionBatch = message.addReactionBatch;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
const value = Reflect.apply(addReactionBatch, message, [reactions, Reflect.apply(getId, authenticationStoreBinding,
|
|
[])]);
|
|
value3.message = value;
|
|
const value5 = value2.conversationMetadataById.get(value3.conversationId);
|
|
if (value5?.hydratedMessages != null) {
|
|
index = value5.hydratedMessages.findIndex(function({id}) {
|
|
return id === messageId;
|
|
});
|
|
if (index !== -1) {
|
|
value5.hydratedMessages[index] = value;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function MESSAGE_REACTION_REMOVE_ALL_42294({channelId, messageId}) { // fn#42294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:12905, offset: 0x011356f7, size: 205 bytes, params: 2, frame: 18
|
|
var index;
|
|
let value = env0_17.peek(channelId);
|
|
if (value == null) {
|
|
return false;
|
|
}
|
|
const value2 = value.messageMetadataByMessageId.get(messageId);
|
|
if (value2?.message == null) {
|
|
return false;
|
|
}
|
|
const value4 = value2.message.set('reactions', []);
|
|
value2.message = value4;
|
|
value = value.conversationMetadataById.get(value2.conversationId);
|
|
if (value?.hydratedMessages != null) {
|
|
index = value.hydratedMessages.findIndex(function({id}) {
|
|
return id === messageId;
|
|
});
|
|
if (index !== -1) {
|
|
value.hydratedMessages[index] = value4;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function MESSAGE_REACTION_REMOVE_EMOJI_42296({channelId, messageId, emoji}) { // fn#42296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:13362, offset: 0x011357c4, size: 203 bytes, params: 2, frame: 16
|
|
var index;
|
|
let value = env0_17.peek(channelId);
|
|
if (value == null) {
|
|
return false;
|
|
}
|
|
const value2 = value.messageMetadataByMessageId.get(messageId);
|
|
if (value2?.message == null) {
|
|
return false;
|
|
}
|
|
const value4 = value2.message.removeReactionsForEmoji(emoji);
|
|
value2.message = value4;
|
|
value = value.conversationMetadataById.get(value2.conversationId);
|
|
if (value?.hydratedMessages != null) {
|
|
index = value.hydratedMessages.findIndex(function({id}) {
|
|
return id === messageId;
|
|
});
|
|
if (index !== -1) {
|
|
value.hydratedMessages[index] = value4;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function LOGOUT_42300() { // fn#42300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5012:14105, offset: 0x01135904, size: 49 bytes, params: 1, frame: 10
|
|
env0_17.reset();
|
|
env0_18.clear();
|
|
env0_19.clear();
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun42230, 4834, [6, 7, 15, 17, 18, 1226, 1379, 3793, 1934, 1878, 4835, 4836, 1393, 21, 4625, 3795, 566,
|
|
694,
|
|
2]) /* metro module 4834, dependencies: [6, 7, 15, 17, 18, 1226, 1379, 3793, 1934, 1878, 4835, 4836, 1393, 21, 4625, 3795, 566, 694, 2] */;
|