Files
discord-decomp/sources/stores/MessageStore.tsx
T
2026-07-27 16:20:00 +03:00

1296 lines
62 KiB
TypeScript

/* Metro module 4814; source: stores/MessageStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 5, 1937, 4815, 1949, 1226, 1379, 4794, 1935, 1945, 1867, 3784, 3793, 1934, 3969, 1878, 661, 3, 21, 4816, 4257, 1910, 4819, 1391, 22, 4625, 4821, 4634, 3795, 4862, 5259, 5260, 1909, 566, 694, 2] */
function _fun41795(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#41795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6, offset: 0x01128347, size: 1073 bytes, params: 8, frame: 25
let env0_0 = require;
const _arrayLikeToArray_41801 = 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 reinjectEphemerals = function(a0, a1) {
var r1;
var value = a1;
var env0_0 = value;
if (value.hasMoreAfter) {
return value;
}
var value3 = EphemeralMessageStore.getMessages(a0);
if (value3.length === 0) {
return value;
}
var value4 = value3.filter(_fun41803);
var env0_1 = value4;
if (value4.length === 0) {
r1 = value;
} else {
value = value.mutate(_fun41804, true);
r1 = value;
}
return r1;
};
const closure = CONNECTION_OPEN_41806;
const closure2 = CHANNEL_DELETE_41813;
const closure3 = RELATIONSHIP_ADD_41815;
const closure4 = MESSAGE_REACTION_ADD_41821;
const closure5 = MESSAGE_SEND_FAILED_AUTOMOD;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const env0_8 = importDefault(57) /* metro dependency 57 */;
const env0_9 = importDefault(5) /* metro dependency 5 */;
const impersonateStore = importDefault(1937) /* metro dependency 1937: ImpersonateStore */;
const ephemeralMessageStore = importDefault(4815) /* metro dependency 4815: EphemeralMessageStore */;
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const dimensionStore = importDefault(4794) /* metro dependency 4794: DimensionStore */;
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_24 = constantsModule.MessageFlags;
const env0_25 = constantsModule.MessageStates;
const env0_26 = constantsModule.MessageTypes;
const env0_27 = constantsModule.Permissions;
const Set = global.Set;
let set = new Set();
set = importDefault(3) /* metro dependency 3: Logger */;
set = new set('MessageStore');
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun41825(Store).displayName = 'MessageStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */,
{BACKGROUND_SYNC_CHANNEL_MESSAGES: BACKGROUND_SYNC_CHANNEL_MESSAGES_41850, CONNECTION_OPEN: closure,
OVERLAY_INITIALIZE: closure, CACHE_LOADED: CACHE_LOADED_41851, LOAD_MESSAGES: function() {
return true;
}, LOAD_MESSAGES_SUCCESS: LOAD_MESSAGES_SUCCESS_41853, LOAD_MESSAGES_FAILURE: LOAD_MESSAGES_FAILURE,
LOAD_MESSAGES_SUCCESS_CACHED: LOAD_MESSAGES_SUCCESS_CACHED, LOCAL_MESSAGES_LOADED: LOCAL_MESSAGES_LOADED_41856,
LOAD_MESSAGE_INTERACTION_DATA_SUCCESS: LOAD_MESSAGE_INTERACTION_DATA_SUCCESS,
TRUNCATE_MESSAGES: TRUNCATE_MESSAGES, CLEAR_MESSAGES: CLEAR_MESSAGES, MESSAGE_CREATE: MESSAGE_CREATE_41861,
MESSAGE_SEND_FAILED: MESSAGE_SEND_FAILED, MESSAGE_SEND_FAILED_AUTOMOD: closure5,
MESSAGE_EDIT_FAILED_AUTOMOD: closure5, MESSAGE_UPDATE: MESSAGE_UPDATE_41865,
MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT: MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT,
MESSAGE_DELETE: MESSAGE_DELETE_41868, MESSAGE_DELETE_BULK: MESSAGE_DELETE_BULK, MESSAGE_REVEAL: MESSAGE_REVEAL,
THREAD_CREATE_LOCAL: THREAD_CREATE_LOCAL, CHANNEL_DELETE: closure2, THREAD_DELETE: closure2,
GUILD_DELETE: closure2, RELATIONSHIP_ADD: closure3, RELATIONSHIP_UPDATE: closure3,
RELATIONSHIP_REMOVE: closure3, GUILD_MEMBERS_CHUNK_BATCH: function(a0) {
var r2;
var value4;
var value2 = _createForOfIteratorHelperLoose_41799(a0.chunks);
var value3 = value2();
if (!value3.done) {
for (r2 = value3; true; r2 = value4) {
performAuthorUpdate(r2.value.guildId);
value4 = value2();
if (value4.done) {
break;
}
}
}
}, THREAD_MEMBER_LIST_UPDATE: function(a0) {
performAuthorUpdate(a0.guildId);
}, MESSAGE_REACTION_ADD: closure4, MESSAGE_REACTION_ADD_MANY: MESSAGE_REACTION_ADD_MANY_41877,
MESSAGE_REACTION_REMOVE: closure4, MESSAGE_REACTION_REMOVE_ALL: MESSAGE_REACTION_REMOVE_ALL_41879,
MESSAGE_REACTION_REMOVE_EMOJI: MESSAGE_REACTION_REMOVE_EMOJI_41881, LOGOUT: LOGOUT_41883,
UPLOAD_START: UPLOAD_START, UPLOAD_FAIL: UPLOAD_FAIL, LOCAL_MESSAGE_CREATE: function({message}) {
var value2 = UserStore.getCurrentUser();
if (message != null && message.author != null && value2 != null && message.author.id === value2.id) {
env0_30 = true;
}
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/MessageStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_41796() { // fn#41796, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:401, offset: 0x01128778, 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_41796_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_41799(a0, a1) { // fn#41799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:594, offset: 0x011287d6, 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 _fun41800;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_41801(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_41801(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_41801(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun41800;
}
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 reinjectEphemerals(a0, a1) { // fn#41802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1555, offset: 0x01128948, size: 106 bytes, params: 3, frame: 15
var r1;
let value = a1;
if (value.hasMoreAfter) {
return value;
}
const messages = EphemeralMessageStore.getMessages(a0);
if (messages.length === 0) {
return value;
}
if (messages.filter(function(a0) {
return !require.has(a0.id);
}).length === 0) {
r1 = value;
} else {
value = value.mutate(_fun41804, true);
r1 = value;
}
return r1;
}
function CONNECTION_OPEN_41806() { // fn#41806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1803, offset: 0x01128a38, size: 58 bytes, params: 1, frame: 13
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).forEach(_fun41807);
env0_28.clear();
}
function _addPushNotificationMessageIfNotCached() { // fn#41808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1923, offset: 0x01128ab4, size: 48 bytes, params: 1, frame: 14
return env0_9(_fun41810).apply(this, arguments);
}
function cleanMediaMention(a0) { // fn#41811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2400, offset: 0x01128c10, size: 150 bytes, params: 2, frame: 16
var attachment_id;
var value3;
var newest;
const env0_0 = a0;
if (a0 != null) {
attachment_id = a0.mediaMention?.attachment_id;
if (attachment_id != null) {
value3 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(attachment_id);
if (value3 != null) {
newest = value3.findNewest(_fun41812);
if (newest != null) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value3.remove(newest.id));
}
}
}
}
}
function CHANNEL_DELETE_41813() { // fn#41813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2695, offset: 0x01128cd2, size: 44 bytes, params: 1, frame: 12
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).forEach(_fun41814);
}
function RELATIONSHIP_ADD_41815() { // fn#41815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2800, offset: 0x01128d42, size: 54 bytes, params: 1, frame: 12
const env0_0 = false;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).forEach(_fun41816);
return env0_0;
}
function performAuthorUpdate(a0) { // fn#41818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3099, offset: 0x01128e4e, size: 51 bytes, params: 2, frame: 12
const env0_0 = a0;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).forEach(_fun41819);
}
function MESSAGE_REACTION_ADD_41821(a0) { // fn#41821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3436, offset: 0x01128f93, size: 205 bytes, params: 2, frame: 20
const env0_0 = a0;
const env0_1 = a0.type;
const channelId = a0.channelId;
const messageId = a0.messageId;
const userId = a0.userId;
const env0_2 = a0.emoji;
const env0_3 = a0.reactionType;
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(channelId);
if (value2 != null) {
var moduleValue = require(3795) /* metro dependency 3795: ReactionUtils */;
if (moduleValue.shouldApplyReaction(a0)) {
var result = AuthenticationStore.getId() === userId;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId,
_fun41822));
return undefined;
}
}
return false;
}
function MESSAGE_EDIT_FAILED_AUTOMOD({type, messageData}) { // fn#41823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3765, offset: 0x011290b1, size: 157 bytes, params: 2, frame: 17
const message = messageData.message;
const failedMessageId = (require(4862) /* metro dependency 4862: MessageQueue */).getFailedMessageId(messageData);
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(message.channelId);
if (orCreate.has(failedMessageId)) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(orCreate.update(failedMessageId,
_fun41824));
return undefined;
}
return false;
}
function _fun41825(a0) { // fn#41825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:4193, offset: 0x01129201, size: 429 bytes, params: 2, frame: 16
const closure = MessageStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(AuthenticationStore, ChannelStore, DimensionStore, EphemeralMessageStore, GuildChannelStore,
GuildMemberStore, GuildStore, ImpersonateStore, LocaleStore, PermissionStore, RelationshipStore,
SelectedChannelStore, SelectedGuildStore, UserStore);
this.syncWith([ImpersonateStore], _fun41828);
}}, {key: 'getMessages', value: value_41829}, {key: 'getMessage', value: value_41830},
{key: 'getLastEditableMessage', value: value_41831}, {key: 'getLastChatCommandMessage', value: value_41833},
{key: 'getLastMessage', value: value_41835}, {key: 'getLastNonCurrentUserMessage', value: value_41836},
{key: 'jumpedMessageId', value: value_41838}, {key: 'focusedMessageId', value: value_41839}, {key: 'hasPresent',
value: value_41840}, {key: 'isReady', value: value_41841}, {key: 'whenReady', value: function(a0, a1) {
var env0_0 = this;
var env0_1 = a0;
var env0_2 = a1;
this.addConditionalChangeListener(_fun41843);
}}, {key: 'isLoadingMessages', value: value_41844}, {key: 'hasCurrentUserSentMessage', value: value_41845},
{key: 'hasCurrentUserSentWaveBlockingMessage', value: value_41847},
{key: 'hasCurrentUserSentMessageSinceAppStart', value: value_41849}]);
}
function BACKGROUND_SYNC_CHANNEL_MESSAGES_41850({changesByChannelId}) { // fn#41850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6850, offset: 0x01129a6c, size: 292 bytes, params: 2, frame: 43
var r14;
var propertyName;
var propertyName2;
var defaultImport;
var get;
var value2;
var property;
var isConnected;
var isConnected2;
var cached;
var binding;
var log;
var ready;
var hasMoreAfter;
var HermesInternal;
var concat;
var mergeDelta;
var new_messages;
var modified_messages;
var deleted_message_ids;
const properties = Object.keys(changesByChannelId);
const properties3 = properties.length;
if (properties !== undefined) {
r14 = 0;
reducibleLoop1: while (true) {
propertyName = properties[r14];
propertyName2 = r14 + 1;
if (propertyName === undefined) {
break reducibleLoop1;
}
defaultImport = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
get = defaultImport.get;
value2 = Reflect.apply(get, defaultImport, [propertyName]);
if (value2 == null) {
r14 = propertyName2;
continue reducibleLoop1;
}
property = (require(4257) /* metro dependency 4257: GatewayConnectionStore */).default;
isConnected = property.isConnected;
isConnected2 = Reflect.apply(isConnected, property, []);
cached = value2.cached;
if (!cached) {
reducibleJoin6: while (true) {
if (isConnected2) {
binding = env0_29;
log = binding.log;
cached = value2.cached;
ready = value2.ready;
hasMoreAfter = value2.hasMoreAfter;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(log, binding,
['Skipping background message sync for ' + propertyName + ' cached:' + cached + ' ready:' + ready + ' hasMoreAfter:' + hasMoreAfter + ' isConnected:' + isConnected2]);
r14 = propertyName2;
continue reducibleLoop1;
}
break reducibleJoin6;
}
}
mergeDelta = value2.mergeDelta;
new_messages = changesByChannelId[propertyName].new_messages;
modified_messages = changesByChannelId[propertyName].modified_messages;
deleted_message_ids = changesByChannelId[propertyName].deleted_message_ids;
Reflect.apply(mergeDelta, value2, [new_messages, modified_messages, deleted_message_ids]);
r14 = propertyName2;
continue reducibleLoop1;
}
}
}
function CACHE_LOADED_41851({messages}) { // fn#41851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:7328, offset: 0x01129b90, size: 179 bytes, params: 2, frame: 24
var r2;
var value4;
var value5;
var property;
var property2;
var defaultImport2;
var orCreate;
var value7;
var defaultImport3;
var value8;
const _createForOfIteratorHelperLoose_41799Binding = _createForOfIteratorHelperLoose_41799;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const value2 = _createForOfIteratorHelperLoose_41799Binding(defaultImport.entries(messages));
const value3 = value2();
let done = value3.done;
if (!done) {
for (r2 = value3; true; r2 = value8) {
value4 = r2.value;
value5 = env0_8(value4, 2);
property = value5[0];
property2 = value5[1];
defaultImport2 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
orCreate = defaultImport2.getOrCreate(property);
value7 = orCreate.addCachedMessages(property2, true);
defaultImport3 = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
defaultImport3.commit(value7);
value8 = value2();
done = value8.done;
if (done) {
break;
}
}
}
}
function LOAD_MESSAGES_SUCCESS_41853({channelId, isBefore, isAfter, jump, hasMoreBefore, hasMoreAfter, messages, isStale, truncate, avoidInitialScroll}) { // fn#41853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:7632, offset: 0x01129c43, size: 252 bytes, params: 2, frame: 25
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
const complete = orCreate.loadComplete({newMessages: messages, isBefore: isBefore, isAfter: isAfter, jump: jump,
hasMoreBefore: hasMoreBefore, hasMoreAfter: hasMoreAfter, cached: isStale, hasFetched: true,
avoidInitialScroll: avoidInitialScroll});
let r2 = truncate == null || !isBefore && !isAfter;
r2 = !r2 ? isBefore && isAfter : r2;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(reinjectEphemerals(channelId,
r2 ? complete : complete.truncate(isBefore, isAfter)));
}
function LOAD_MESSAGES_FAILURE({channelId}) { // fn#41854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:8072, offset: 0x01129d3f, size: 91 bytes, params: 2, frame: 15
let value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.getOrCreate(channelId);
const defaultImport = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
defaultImport.commit(value.mutate({'loadingMore': false, 'error': true}));
}
function LOAD_MESSAGES_SUCCESS_CACHED({channelId, jump, focus, before, after, limit, truncate}) { // fn#41855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:8235, offset: 0x01129d9a, size: 349 bytes, params: 2, frame: 30
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
const r8 = jump == null ? focus?.messageId != null ? orCreate.focusOnMessage(focus.messageId) : jump?.messageId != null ? orCreate.jumpToMessage(jump.messageId,
jump.flash, jump.offset, jump.returnMessageId,
jump.jumpType) : before == null && after == null ? orCreate : orCreate.loadFromCache(before != null,
limit) : jump.present ? orCreate.jumpToPresent(limit) : focus?.messageId != null ? orCreate.focusOnMessage(focus.messageId) : jump?.messageId != null ? orCreate.jumpToMessage(jump.messageId,
jump.flash, jump.offset, jump.returnMessageId,
jump.jumpType) : before == null && after == null ? orCreate : orCreate.loadFromCache(before != null, limit);
let r7 = truncate == null || before == null && after == null;
r7 = !r7 ? before != null && after != null : r7;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(reinjectEphemerals(channelId,
r7 ? r8 : r8.truncate(before != null, after != null)));
}
function LOCAL_MESSAGES_LOADED_41856(a0) { // fn#41856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:8785, offset: 0x01129ef7, size: 221 bytes, params: 2, frame: 18
var r2;
var value3;
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(a0.channelId);
if (a0.isForegroundCacheLoad) {
value3 = orCreate.addCachedMessages(a0.messages, a0.stale);
r2 = a0.isForegroundCacheLoad && a0.messages.length > 0;
r2 = r2 && value3.jumpTargetId == null;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r2 ? value3.mutate({initialScrollSequenceId: value3.initialScrollSequenceId + 1,
suppressRowAnimationSequenceId: value3.suppressRowAnimationSequenceId + 1}) : value3);
} else if (orCreate.cached) {
value3 = orCreate.addCachedMessages(a0.messages, a0.stale);
r2 = a0.isForegroundCacheLoad && a0.messages.length > 0;
r2 = r2 && value3.jumpTargetId == null;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r2 ? value3.mutate({initialScrollSequenceId: value3.initialScrollSequenceId + 1,
suppressRowAnimationSequenceId: value3.suppressRowAnimationSequenceId + 1}) : value3);
} else if (!orCreate.ready) {
value3 = orCreate.addCachedMessages(a0.messages, a0.stale);
r2 = a0.isForegroundCacheLoad && a0.messages.length > 0;
r2 = r2 && value3.jumpTargetId == null;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r2 ? value3.mutate({initialScrollSequenceId: value3.initialScrollSequenceId + 1,
suppressRowAnimationSequenceId: value3.suppressRowAnimationSequenceId + 1}) : value3);
}
}
function LOAD_MESSAGE_INTERACTION_DATA_SUCCESS(a0) { // fn#41857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:9218, offset: 0x01129fd4, size: 124 bytes, params: 2, frame: 17
const env0_0 = a0;
const messageId = a0.messageId;
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(a0.channelId);
if (value2 != null) {
if (value2.has(messageId)) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId,
_fun41858));
return undefined;
}
}
return false;
}
function TRUNCATE_MESSAGES({channelId, truncateBottom, truncateTop}) { // fn#41859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:9451, offset: 0x0112a071, size: 149 bytes, params: 2, frame: 22
env0_29.log('Truncating messages for ' + channelId + ' bottom:' + truncateBottom + ' top:' + truncateTop);
let value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.getOrCreate(channelId);
value = value.truncate(truncateBottom, truncateTop);
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value);
}
function CLEAR_MESSAGES({channelId}) { // fn#41860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:9671, offset: 0x0112a106, size: 99 bytes, params: 2, frame: 14
env0_29.log('Clearing messages for ' + channelId);
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).clear(channelId);
env0_28.clear();
}
function MESSAGE_CREATE_41861({channelId, message, optimistic, isPushNotification}) { // fn#41861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:9795, offset: 0x0112a169, size: 634 bytes, params: 2, frame: 25
var r2;
var r9;
var r12;
var r0;
var r1;
var ready;
var nonce;
var binding;
var remove;
var value10;
var media_mention;
var attachment_id;
var orCreate;
var object2;
var moduleValue;
var value;
const orCreate2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
const isConnected2 = (require(4257) /* metro dependency 4257: GatewayConnectionStore */).default.isConnected();
if (isPushNotification) {
moduleValue = require(4819) /* metro dependency 4819: IOSPushNotificationRawPayloadFixExperiment */;
if (moduleValue.isIOSPushNotificationRawPayloadFixExperimentEnabled()) {
(function() {
return _addPushNotificationMessageIfNotCached.apply(this, arguments);
})(channelId, message, isConnected2);
r1 = false;
} else {
binding = env0_29;
binding.log('Inserting message tapped on from a push notification', message.id, message.channel_id);
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value.commit(orCreate2.receivePushNotification(message, isConnected2));
r1 = undefined;
}
r0 = r1;
} else {
ready = orCreate2.ready;
if (ready) {
r2 = optimistic ? !orCreate2.has(message.id) : !optimistic;
if (r2) {
nonce = message.nonce;
r9 = nonce != null && message.state !== MessageStates.SENDING;
if (r9) {
binding = env0_28;
r9 = binding.has(message.nonce);
}
if (r9) {
remove = orCreate2.remove;
nonce = message.nonce;
value10 = Reflect.apply(remove, orCreate2, [nonce]);
binding = env0_28;
nonce = message.nonce;
binding.delete(nonce);
r12 = value10;
} else {
r12 = orCreate2;
}
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r12.receiveMessage(message,
DimensionStore.isAtBottom(channelId) === true));
media_mention = message.media_mention;
if (media_mention != null) {
media_mention = message.media_mention;
if (media_mention.message_id != null) {
media_mention = message.media_mention;
attachment_id = media_mention.attachment_id;
orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(attachment_id);
object2 = {};
copyDataProperties(object2, message, undefined);
object2['channel_id'] = attachment_id;
object2['type'] = MessageTypes.MEDIA_MENTION_MESSAGE;
media_mention = message.media_mention;
object2['id'] = media_mention.message_id;
object2['message_reference'] = undefined;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(orCreate.receiveMessage(object2,
false));
r2 = undefined;
} else {
r2 = undefined;
}
} else {
r2 = undefined;
}
}
r0 = r2;
} else {
r0 = !!ready;
}
}
return r0;
}
function MESSAGE_SEND_FAILED({channelId, messageId, reason}) { // fn#41863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:10818, offset: 0x0112a401, size: 180 bytes, params: 2, frame: 19
var r3;
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
if (orCreate != null) {
if (orCreate.has(messageId)) {
r3 = orCreate.get(messageId, true)?.isPoll();
r3 = r3 === true ? orCreate.remove(messageId) : orCreate.update(messageId, _fun41864);
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r3);
return undefined;
}
}
return false;
}
function MESSAGE_UPDATE_41865(a0) { // fn#41865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:11378, offset: 0x0112a57e, size: 135 bytes, params: 2, frame: 17
const env0_0 = a0;
const id = a0.message.id;
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(a0.message.channel_id);
if (orCreate != null) {
if (orCreate.has(id)) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(orCreate.update(id, _fun41866));
return undefined;
}
}
return false;
}
function MESSAGE_EXPLICIT_CONTENT_SCAN_TIMEOUT({messageId, channelId}) { // fn#41867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:11629, offset: 0x0112a63b, size: 135 bytes, params: 2, frame: 18
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(channelId);
if (value2 != null) {
if (value2.has(messageId)) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId,
(require(4821) /* metro dependency 4821: ExplicitMediaRedactionUtils */).handleExplicitMediaScanTimeoutForMessage));
return undefined;
}
}
return false;
}
function MESSAGE_DELETE_41868({id, channelId}) { // fn#41868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:11858, offset: 0x0112a6c2, size: 235 bytes, params: 2, frame: 18
var r4;
var after;
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
if (orCreate != null) {
if (orCreate.has(id)) {
if (orCreate.revealedMessageId !== id) {
r4 = orCreate;
} else {
after = orCreate.getAfter(id);
r4 = after == null ? orCreate.mutate({revealedMessageId: null}) : after.blocked ? orCreate.mutate({revealedMessageId: after.id}) : orCreate.mutate({revealedMessageId: null});
}
cleanMediaMention(r4.get(id));
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r4.remove(id));
env0_28.delete(id);
return undefined;
}
}
return false;
}
function MESSAGE_DELETE_BULK({ids, channelId}) { // fn#41869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12201, offset: 0x0112a7ad, size: 298 bytes, params: 2, frame: 20
var r5;
var defaultImport2;
const orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
if (orCreate == null) {
return false;
}
ids.forEach(_fun41870);
const value3 = orCreate.removeMany(ids);
if (orCreate === value3) {
return false;
}
if (value3.revealedMessageId == null) {
r5 = value3;
} else {
defaultImport2 = importDefault(22) /* metro dependency 22 */;
r5 = defaultImport2.some(ids,
_fun41871) ? value3.getAfter(value3.revealedMessageId) == null ? value3.mutate({revealedMessageId: null}) : value3.getAfter(value3.revealedMessageId).blocked ? value3.mutate({revealedMessageId: value3.getAfter(value3.revealedMessageId).id}) : value3.mutate({revealedMessageId: null}) : value3;
}
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(r5);
ids.forEach(_fun41872);
}
function MESSAGE_REVEAL({channelId, messageId}) { // fn#41873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12662, offset: 0x0112a929, size: 89 bytes, params: 2, frame: 16
let value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.getOrCreate(channelId);
const defaultImport = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
defaultImport.commit(value.mutate({revealedMessageId: messageId}));
}
function THREAD_CREATE_LOCAL({channelId}) { // fn#41874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12818, offset: 0x0112a982, size: 101 bytes, params: 2, frame: 16
let value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.getOrCreate(channelId);
value = value.loadComplete({'newMessages': null, 'hasMoreAfter': false, 'hasMoreBefore': false, newMessages: []});
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value);
}
function MESSAGE_REACTION_ADD_MANY_41877({channelId, messageId, reactions}) { // fn#41877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:13537, offset: 0x0112aa46, size: 117 bytes, params: 2, frame: 17
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(channelId);
if (value2 == null) {
return false;
}
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId, _fun41878));
}
function MESSAGE_REACTION_REMOVE_ALL_41879({channelId, messageId}) { // fn#41879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:13837, offset: 0x0112aaf3, size: 107 bytes, params: 2, frame: 16
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(channelId);
if (value2 == null) {
return false;
}
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId, function(a0) {
return a0.set('reactions', []);
}));
}
function MESSAGE_REACTION_REMOVE_EMOJI_41881({channelId, messageId, emoji}) { // fn#41881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:14031, offset: 0x0112ab5e, size: 117 bytes, params: 2, frame: 17
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(channelId);
if (value2 == null) {
return false;
}
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value2.update(messageId, function(a0) {
return a0.removeReactionsForEmoji(emoji);
}));
}
function LOGOUT_41883() { // fn#41883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:14219, offset: 0x0112abd3, size: 58 bytes, params: 1, frame: 13
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).forEach(_fun41884);
env0_28.clear();
}
function UPLOAD_START({message}) { // fn#41885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:14320, offset: 0x0112ac3b, size: 56 bytes, params: 2, frame: 13
var binding;
if (message?.nonce != null) {
binding = env0_28;
binding.add(message.nonce);
}
}
function UPLOAD_FAIL({channelId, messageId}) { // fn#41886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:14420, offset: 0x0112ac73, size: 175 bytes, params: 2, frame: 16
var orCreate;
var value3;
var value4;
var value5;
if (messageId != null) {
var value;
var binding = env0_28;
if (binding.has(messageId)) {
orCreate = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(channelId);
value3 = orCreate.get(messageId);
if (value3 == null) {
return false;
}
value4 = orCreate.remove(messageId);
value5 = value4.merge([value3]);
env0_28.delete(messageId);
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).commit(value5);
return undefined;
}
}
return false;
}
function _fun41804(a0) { // fn#41804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1729, offset: 0x011289d0, size: 49 bytes, params: 2, frame: 11
a0._merge(env0_1);
a0._array.sort(_fun41805);
}
function _fun41807(a0) { // fn#41807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1853, offset: 0x01128a72, size: 66 bytes, params: 2, frame: 14
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value.commit(a0.mutate({'ready': false, 'loadingMore': false}));
}
function* _fun41810(a0, a1, a2) { // fn#41810, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2022, offset: 0x01128aed, size: 291 bytes, params: 4, frame: 22
var binding;
var value3;
var database;
var value4;
var getBasicChannel;
var value5;
var binding2;
var property;
var value6;
var messages;
var value7;
var get;
var guild_id;
var id;
var value8;
var value9;
var value10;
var value11;
var error;
if (true) {
reduciblePort21: while (true) {
exceptionLanding20: while (true) {
value = environment.__proto__.__proto__;
binding = env2_1;
value3 = binding(env2_2[26]);
database = value3.database;
value4 = Reflect.apply(database, value3, []);
binding = env2_14;
getBasicChannel = binding.getBasicChannel;
value5 = Reflect.apply(getBasicChannel, binding, [a0]);
if (value4 == null) {
break reduciblePort21;
}
if (value5 == null) {
break reduciblePort21;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding20;
}
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding20;
}
try {
property = binding2[26];
} catch (error) {
break exceptionLanding20;
}
try {
value6 = binding(property);
} catch (error) {
break exceptionLanding20;
}
try {
messages = value6.messages;
} catch (error) {
break exceptionLanding20;
}
try {
value7 = Reflect.apply(messages, value6, [value4]);
} catch (error) {
break exceptionLanding20;
}
try {
get = value7.get;
} catch (error) {
break exceptionLanding20;
}
try {
guild_id = value5.guild_id;
} catch (error) {
break exceptionLanding20;
}
try {
id = a1.id;
} catch (error) {
break exceptionLanding20;
}
try {
value8 = Reflect.apply(get, value7, [guild_id, a0, id]);
} catch (error) {
break exceptionLanding20;
}
yield value8;
try {
value9 = undefined;
value10 = false;
} catch (error) {
break exceptionLanding20;
}
if (value10) {
return value9;
}
try {
value11 = value9 != null;
} catch (error) {
break exceptionLanding20;
}
if (value11) {
return undefined;
}
break reduciblePort21;
}
break reduciblePort21;
}
binding = env2_29;
binding.log('Push notification message not in cache, adding directly', a1.id, a1.channel_id);
binding = env2_1;
var binding3 = env2_2;
var orCreate = binding(binding3[24]).getOrCreate(a0);
var value14 = binding(binding3[24]);
value14.commit(orCreate.receivePushNotification(a1, a2));
env2_31.emitChange();
}
}
function _fun41812({messageReference}) { // fn#41812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2568, offset: 0x01128ca6, size: 44 bytes, params: 2, frame: 3
return messageReference?.message_id === env0_0.id;
}
function _fun41814({channelId}) { // fn#41814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2738, offset: 0x01128cfe, size: 68 bytes, params: 2, frame: 12
const value = environment.__proto__;
if (ChannelStore.getChannel(channelId) == null) {
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).clear(channelId);
}
}
function _fun41816(a0) { // fn#41816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2870, offset: 0x01128d78, size: 69 bytes, params: 2, frame: 15
var environment;
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value.commit(a0.reset(a0.map(_fun41817)));
}
function _fun41819(a0) { // fn#41819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3149, offset: 0x01128e81, size: 136 bytes, params: 2, frame: 15
var environment;
var items2;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(a0.channelId);
const value3 = undefined;
if ((channel == null ? value3 : channel.guild_id) === env0_0) {
items2 = [];
var env0_1 = false;
a0.forEach(_fun41820);
if (env0_1) {
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value.commit(a0.reset(items2));
}
}
return value3;
}
function _fun41822(a0) { // fn#41822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3660, offset: 0x01129060, size: 81 bytes, params: 2, frame: 18
return type === 'MESSAGE_REACTION_ADD' ? a0.addReaction(emoji, result, env0_0.colors,
reactionType) : a0.removeReaction(emoji, result, reactionType);
}
function _fun41824(a0) { // fn#41824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3955, offset: 0x0112914e, size: 179 bytes, params: 2, frame: 17
var r4;
var r0;
var set;
var moduleValue;
let value = a0;
const embeds = value.embeds;
if ((embeds == null ? undefined : embeds.filter((require(5259) /* metro dependency 5259: GuildAutomodMessageStoreUtils */).isNotAutomodEmbed).length) > 0) {
value = value.set('embeds', []);
r4 = value;
} else {
r4 = value;
}
if (type !== 'MESSAGE_SEND_FAILED_AUTOMOD') {
r0 = r4;
} else {
set = r4.set;
value = environment.__proto__;
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
value = moduleValue.addFlag(r4.flags, MessageFlags.EPHEMERAL);
value = Reflect.apply(set, r4, ['flags', value]);
r0 = value;
}
return r0;
}
function value_41827() { // fn#41827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:4483, offset: 0x0112941f, size: 109 bytes, params: 1, frame: 37
this.waitFor(AuthenticationStore, ChannelStore, DimensionStore, EphemeralMessageStore, GuildChannelStore,
GuildMemberStore, GuildStore, ImpersonateStore, LocaleStore, PermissionStore, RelationshipStore,
SelectedChannelStore, SelectedGuildStore, UserStore);
this.syncWith([ImpersonateStore], function() {
});
}
function value_41829(a0) { // fn#41829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:4591, offset: 0x0112948c, size: 192 bytes, params: 2, frame: 16
var channel;
var value5;
let value = environment.__proto__;
if (ImpersonateStore.hasViewingRoles()) {
channel = ChannelStore.getChannel(a0);
if (ImpersonateStore.isViewingRoles(channel?.getGuildId())) {
if (PermissionStore.can(Permissions.VIEW_CHANNEL, channel)) {
return (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(a0);
}
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value5 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(a0);
return value instanceof Object ? value : value5;
}
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
return value.getOrCreate(a0);
}
return (importDefault(4816) /* metro dependency 4816: ChannelMessages */).getOrCreate(a0);
}
function value_41830(a0, a1) { // fn#41830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:4811, offset: 0x0112954c, size: 54 bytes, params: 3, frame: 11
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.getOrCreate(a0);
return value.get(a1);
}
function value_41831(a0) { // fn#41831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:4901, offset: 0x01129582, size: 104 bytes, params: 2, frame: 14
var environment;
let value = environment.__proto__;
const env0_0 = UserStore.getCurrentUser();
value = importDefault(22) /* metro dependency 22 */;
const messages = this.getMessages(a0);
value = value(messages.toArray());
value = value.reverse();
return value.find(_fun41832);
}
function value_41833(a0) { // fn#41833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5079, offset: 0x01129629, size: 77 bytes, params: 2, frame: 12
var environment;
let value = environment.__proto__;
const env0_0 = UserStore.getCurrentUser();
value = this.getMessages(a0);
value = value.toArray();
value = value.reverse();
return value.find(_fun41834);
}
function value_41835(a0) { // fn#41835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5441, offset: 0x01129722, size: 81 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
const messages = this.getMessages(a0);
value = value(messages.toArray());
value = value.reverse();
return value.get(0);
}
function value_41836(a0) { // fn#41836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5561, offset: 0x01129773, size: 104 bytes, params: 2, frame: 14
var environment;
let value = environment.__proto__;
const env0_0 = UserStore.getCurrentUser();
value = importDefault(22) /* metro dependency 22 */;
const messages = this.getMessages(a0);
value = value(messages.toArray());
value = value.reverse();
return value.find(_fun41837);
}
function value_41838(a0) { // fn#41838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5733, offset: 0x0112980a, size: 55 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = undefined;
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(a0);
return value2 == null ? value : value2.jumpTargetId;
}
function value_41839(a0) { // fn#41839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5836, offset: 0x01129841, size: 55 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = undefined;
const value2 = (importDefault(4816) /* metro dependency 4816: ChannelMessages */).get(a0);
return value2 == null ? value : value2.focusTargetId;
}
function value_41840(a0) { // fn#41840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5934, offset: 0x01129878, size: 68 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
value = value.get(a0);
let r0 = value != null && value.ready;
if (r0) {
value = value.hasPresent();
r0 = value;
}
return r0;
}
function value_41841(a0) { // fn#41841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6031, offset: 0x011298bc, size: 47 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
const getOrCreate = value.getOrCreate;
return Reflect.apply(getOrCreate, value, [a0]).ready;
}
function value_41842(a0, a1) { // fn#41842, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6105, offset: 0x011298eb, size: 43 bytes, params: 3, frame: 11
const env0_1 = a0;
const env0_2 = a1;
this.addConditionalChangeListener(_fun41843);
}
function value_41844(a0) { // fn#41844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6240, offset: 0x01129948, size: 47 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = importDefault(4816) /* metro dependency 4816: ChannelMessages */;
const getOrCreate = value.getOrCreate;
return Reflect.apply(getOrCreate, value, [a0]).loadingMore;
}
function value_41845(a0) { // fn#41845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6336, offset: 0x01129977, size: 63 bytes, params: 2, frame: 12
var environment;
let value = environment.__proto__;
const env0_0 = UserStore.getCurrentUser();
value = this.getMessages(a0);
value = value.findNewest(_fun41846);
return value != null;
}
function value_41847(a0) { // fn#41847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6512, offset: 0x011299e5, size: 63 bytes, params: 2, frame: 12
var environment;
let value = environment.__proto__;
const env0_0 = UserStore.getCurrentUser();
value = this.getMessages(a0);
value = value.findNewest(_fun41848);
return value != null;
}
function _fun41858(a0) { // fn#41858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:9365, offset: 0x0112a050, size: 33 bytes, params: 2, frame: 13
return a0.set('interactionData', env0_0.interactionData);
}
function _fun41864(a0) { // fn#41864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:11018, offset: 0x0112a4b5, size: 201 bytes, params: 2, frame: 16
var r0;
var reasonBinding;
var value5;
var moduleValue;
let set = a0.set;
let value = environment.__proto__;
const SEND_FAILED = MessageStates.SEND_FAILED;
const value2 = Reflect.apply(set, a0, ['state', SEND_FAILED]);
if (value2.isCommandType()) {
value5 = value2.set('interactionError', reason ?? '');
set = value5.set;
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
value = moduleValue.addFlag(value5.flags, MessageFlags.EPHEMERAL);
value = Reflect.apply(set, value5, ['flags', value]);
r0 = value;
} else {
reasonBinding = reason;
if (reasonBinding == null) {
r0 = value2;
} else {
set = value2.set;
reasonBinding = reason;
value = '';
value = Reflect.apply(set, value2, ['interactionError', reasonBinding != null ? reason : value]);
r0 = value;
}
}
return r0;
}
function _fun41866(a0) { // fn#41866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:11523, offset: 0x0112a605, size: 54 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
return value.updateMessageRecord(a0, env0_0.message);
}
function _fun41870(a0) { // fn#41870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12316, offset: 0x0112a8d7, size: 36 bytes, params: 2, frame: 12
const value = environment.__proto__;
cleanMediaMention(env0_0.get(a0));
}
function _fun41871(a0) { // fn#41871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12438, offset: 0x0112a8fb, size: 22 bytes, params: 2, frame: 2
return env0_1.revealedMessageId === a0;
}
function _fun41872(a0) { // fn#41872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:12627, offset: 0x0112a911, size: 24 bytes, params: 2, frame: 11
env1_28.delete(a0);
}
function _fun41878(a0) { // fn#41878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:13667, offset: 0x0112aabb, size: 56 bytes, params: 2, frame: 15
const addReactionBatch = a0.addReactionBatch;
const reactionsBinding = reactions;
const value = environment.__proto__;
return Reflect.apply(addReactionBatch, a0, [reactionsBinding, UserStore.getCurrentUser()?.id]);
}
function _fun41884({channelId}) { // fn#41884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:14261, offset: 0x0112ac0d, size: 46 bytes, params: 2, frame: 12
const value = environment.__proto__;
(importDefault(4816) /* metro dependency 4816: ChannelMessages */).clear(channelId);
}
function _fun41805({id}, {id}) { // fn#41805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:1760, offset: 0x01128a01, size: 55 bytes, params: 3, frame: 13
const value = environment.__proto__.__proto__;
return (importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare(id, id);
}
function _fun41817(a0) { // fn#41817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:2905, offset: 0x01128dbd, size: 145 bytes, params: 2, frame: 15
var r0;
var value3;
var set;
let value = a0;
if (value.blocked === RelationshipStore.isBlockedForMessage(value)) {
r0 = value;
} else {
value3 = environment.__proto__;
value = value.set('blocked', RelationshipStore.isBlockedForMessage(value));
r0 = value;
}
if (r0.ignored !== RelationshipStore.isIgnoredForMessage(r0)) {
value = environment.__proto__;
set = r0.set;
value = RelationshipStore.isIgnoredForMessage(r0);
value = Reflect.apply(set, r0, ['ignored', value]);
r0 = value;
}
return r0;
}
function _fun41820(a0) { // fn#41820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:3246, offset: 0x01128f09, size: 138 bytes, params: 2, frame: 16
var binding;
let value = environment.__proto__.__proto__;
value = require(4634) /* metro dependency 4634: useMessageAuthor */;
value = value.getMessageAuthor(a0);
const nick = value.nick;
const colorString = value.colorString;
if (nick !== a0.nick) {
binding = env0_0;
binding.push(a0.merge({nick: nick, colorString: colorString}));
} else if (colorString !== a0.colorString) {
binding = env0_0;
binding.push(a0.merge({nick: nick, colorString: colorString}));
} else {
env0_0.push(a0);
}
}
function _fun41832(a0) { // fn#41832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5001, offset: 0x011295ea, size: 63 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
return (importDefault(5260) /* metro dependency 5260: canEditMessage */)(a0, env0_0?.id);
}
function _fun41834(a0) { // fn#41834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5169, offset: 0x01129676, size: 172 bytes, params: 2, frame: 17
const interaction = a0.interaction;
const value = undefined;
const type = interaction == null ? value : interaction.type;
const InteractionTypes = (require(1909) /* metro dependency 1909: Server */).InteractionTypes;
const APPLICATION_COMMAND = InteractionTypes.APPLICATION_COMMAND;
return type === APPLICATION_COMMAND && (a0.interactionData == null ? value : a0.interactionData.type) === (require(1909) /* metro dependency 1909: Server */).ApplicationCommandType.CHAT && a0.interaction.user.id === (env0_0 == null ? value : env0_0.id);
}
function _fun41837({author}) { // fn#41837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:5661, offset: 0x011297db, size: 47 bytes, params: 2, frame: 4
return author.id !== env0_0?.id;
}
function _fun41843() { // fn#41843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6154, offset: 0x01129916, size: 50 bytes, params: 1, frame: 12
const binding = env0_0;
if (binding.isReady(env0_1)) {
global.setImmediate(require);
return false;
}
}
function _fun41846({author}) { // fn#41846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6418, offset: 0x011299b6, size: 47 bytes, params: 2, frame: 4
return author.id === env0_0?.id;
}
function _fun41848(a0) { // fn#41848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4992:6594, offset: 0x01129a24, size: 72 bytes, params: 2, frame: 5
const type = a0.type;
const value = environment.__proto__.__proto__;
const FRIEND_REQUEST_ACCEPTED = MessageTypes.FRIEND_REQUEST_ACCEPTED;
return type !== FRIEND_REQUEST_ACCEPTED && a0.author.id === env0_0?.id;
}