Files
discord-decomp/sources/modules/search/SearchRecentMessageStore.tsx
2026-07-28 01:06:53 +03:00

135 lines
6.9 KiB
TypeScript

/* Metro module 9678; source: modules/search/SearchRecentMessageStore.tsx; dependencies: [6, 7, 15, 17, 18, 4625, 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 Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as MessageRecordUtilsModule from '../messages/MessageRecordUtils.tsx'; /* Metro dependency 4625 */
function _fun76023(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:6, offset: 0x01dc1e8b, size: 330 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = function() {
var Map = global.Map;
env0_7 = new Map();
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let Map = global.Map;
let map = new Map();
const env0_8 = [];
const Store = (Flux).Store;
_fun76028(Store).displayName = 'SearchRecentMessageStore';
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
{SEARCH_MESSAGES_SUCCESS: SEARCH_MESSAGES_SUCCESS_76031, SEARCH_RECENT_MESSAGES_CLEAR: closure,
CONNECTION_OPEN: closure});
(FileImportTrackerModule).fileFinishedImporting('modules/search/SearchRecentMessageStore.tsx');
exports.default = map;
function _isNativeReflectConstruct_76024() { // fn#76024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:148, offset: 0x01dc1fd5, size: 98 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_76024_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun76028(a0) { // fn#76028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:399, offset: 0x01dc205e, size: 74 bytes, params: 2, frame: 15
const SearchRecentMessageStore2 = SearchRecentMessageStore;
Inherits(SearchRecentMessageStore2, a0);
return CreateClass(SearchRecentMessageStore2, [{key: 'getRecentMessageAuthorIds', value: value_76030}]);
function SearchRecentMessageStore() { // fn#76029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:411, offset: 0x01081bdc, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, SearchRecentMessageStore);
const value3 = env1_5(SearchRecentMessageStore);
return env1_4(this, _isNativeReflectConstruct_76024() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_76030(a0) { // fn#76030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:764, offset: 0x01dc20a8, size: 32 bytes, params: 2, frame: 12
return env1_7.get(a0) ?? env1_8;
}
}
function SEARCH_MESSAGES_SUCCESS_76031({guildId, data}) { // fn#76031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:918, offset: 0x01dc20c8, size: 173 bytes, params: 2, frame: 17
if (guildId != null) {
var r5 = env0_7.get(guildId) ?? [];
var items2 = [];
arraySpread(items2, r5, 0, data);
var Set = global.Set;
var set = new Set(items2);
data.forEach(function({messages}) {
messages.forEach(_fun76033);
});
if (false) {
env0_7.set(guildId, items2);
}
}
return false;
function _fun76032({messages}) { // fn#76032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:1072, offset: 0x01dc2175, size: 32 bytes, params: 2, frame: 11
messages.forEach(_fun76033);
function _fun76033(a0) { // fn#76033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9864:1096, offset: 0x01dc2195, size: 178 bytes, params: 2, frame: 14
var add;
var push;
const iterator = a0[Symbol.iterator]();
let item2 = iterator.next();
const item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (!value2) {
item2.return();
}
const messageRecord = (MessageRecordUtilsModule).createMessageRecord(r3);
let binding = env1_2;
const has = binding.has;
let author = messageRecord.author;
let id = author.id;
if (!Reflect.apply(has, binding, [id]) && env1_2.size < 15) {
binding = env1_2;
add = binding.add;
author = messageRecord.author;
id = author.id;
Reflect.apply(add, binding, [id]);
binding = env1_1;
push = binding.push;
author = messageRecord.author;
id = author.id;
Reflect.apply(push, binding, [id]);
}
return value;
}
}
}
}
global.__d(_fun76023, 9678, [6, 7, 15, 17, 18, 4625, 566, 694,
2]) /* metro module 9678, dependencies: [6, 7, 15, 17, 18, 4625, 566, 694, 2] */;