146 lines
6.8 KiB
TypeScript
146 lines
6.8 KiB
TypeScript
/* Metro module 7150; source: stores/MessageReactionsStore.tsx; dependencies: [15, 17, 18, 6, 7, 3785, 1885, 1379, 1878, 7151, 566, 694, 2] */
|
|
function _fun57209(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:6, offset: 0x013df719, size: 380 bytes, params: 8, frame: 19
|
|
const closure = MESSAGE_REACTION_ADD_57213;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_3 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_4 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_5 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_6 = importDefault(7) /* metro dependency 7 */;
|
|
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
|
|
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
let env0_11 = {};
|
|
const env0_12 = _fun57214();
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun57217(Store);
|
|
value.displayName = 'MessageReactionsStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
|
|
env0_11 = {};
|
|
}, MESSAGE_REACTION_ADD: closure, MESSAGE_REACTION_REMOVE: closure,
|
|
MESSAGE_REACTION_ADD_USERS: MESSAGE_REACTION_ADD_USERS});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/MessageReactionsStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_57210() { // fn#57210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:188, offset: 0x013df895, 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_57210_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function MESSAGE_REACTION_ADD_57213({type, messageId, userId, emoji, reactionType}) { // fn#57213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:639, offset: 0x013df8f3, size: 118 bytes, params: 2, frame: 18
|
|
var user;
|
|
const value2 = env0_12.ensure(messageId, emoji, reactionType);
|
|
if (type === 'MESSAGE_REACTION_ADD') {
|
|
user = UserStore.getUser(userId);
|
|
if (user != null) {
|
|
value2.users.set(userId, user);
|
|
}
|
|
} else {
|
|
value2.users.delete(userId);
|
|
}
|
|
}
|
|
|
|
function _fun57214() { // fn#57214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:392, offset: 0x013df969, size: 58 bytes, params: 1, frame: 15
|
|
return env0_6(Reaction, null, [{key: 'ensure', value: value_57216}]);
|
|
}
|
|
|
|
function _fun57217(a0) { // fn#57217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:844, offset: 0x013dfa65, size: 91 bytes, params: 2, frame: 16
|
|
const closure = MessageReactionsStore;
|
|
env0_4(closure, a0);
|
|
return env0_6(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(ChannelStore, LurkingStore, UserStore);
|
|
}}, {key: 'getReactions', value: value_57220}]);
|
|
}
|
|
|
|
function MESSAGE_REACTION_ADD_USERS({messageId, users, emoji, reactionType}) { // fn#57222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:1716, offset: 0x013dfba6, size: 71 bytes, params: 2, frame: 17
|
|
const env0_0 = env0_12.ensure(messageId, emoji, reactionType);
|
|
users.forEach(_fun57223);
|
|
}
|
|
|
|
function Reaction() { // fn#57215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:403, offset: 0x013df9a3, size: 69 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
env1_5(this, Reaction);
|
|
this.fetched = false;
|
|
const Map = global.Map;
|
|
this.users = new Map();
|
|
}
|
|
|
|
function value_57216(a0, {name, id}, a2) { // fn#57216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:519, offset: 0x013df9e8, size: 125 bytes, params: 4, frame: 22
|
|
var r0;
|
|
var reaction;
|
|
let value = '';
|
|
value = value + a0 + ':' + name + ':' + (id ?? value) + ':' + a2;
|
|
const binding = env1_11;
|
|
const property = binding[value];
|
|
if (property != null) {
|
|
r0 = property;
|
|
} else {
|
|
reaction = new Reaction();
|
|
}
|
|
binding[value] = r0;
|
|
return r0;
|
|
}
|
|
|
|
function value_57220(a0, a1, a2, a3, a4) { // fn#57220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:1238, offset: 0x013dfae3, size: 182 bytes, params: 6, frame: 20
|
|
var r8;
|
|
const value = environment.__proto__;
|
|
const value2 = env1_12.ensure(a1, a2, a4);
|
|
if (!value2.fetched) {
|
|
var channel = ChannelStore.getChannel(a0);
|
|
var value4 = null;
|
|
r8 = value4 != channel ? channel.getGuildId() : value4;
|
|
if (value4 == r8) {
|
|
(importAll(7151) /* metro dependency 7151: ReactionActionCreators */).getReactors({channelId: a0,
|
|
messageId: a1,
|
|
emoji: a2, limit: a3, type: a4});
|
|
value2.fetched = true;
|
|
return value2.users;
|
|
}
|
|
if (LurkingStore.isLurking(r8)) {
|
|
return undefined;
|
|
}
|
|
(importAll(7151) /* metro dependency 7151: ReactionActionCreators */).getReactors({channelId: a0, messageId: a1,
|
|
emoji: a2, limit: a3, type: a4});
|
|
value2.fetched = true;
|
|
}
|
|
return value2.users;
|
|
}
|
|
|
|
function _fun57223(a0) { // fn#57223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7328:1827, offset: 0x013dfbed, size: 64 bytes, params: 2, frame: 15
|
|
const users = env0_0.users;
|
|
const set = users.set;
|
|
const id = a0.id;
|
|
const value = environment.__proto__;
|
|
const userRecord = new UserRecord(a0);
|
|
return Reflect.apply(set, users, [id, userRecord]);
|
|
}
|
|
|