227 lines
9.3 KiB
TypeScript
227 lines
9.3 KiB
TypeScript
/* Metro module 6611; source: modules/notifications/LastMentionTimestampStore.tsx; dependencies: [6, 7, 15, 17, 18, 1945, 4864, 1878, 694, 566, 2] */
|
|
function _fun52208(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:6, offset: 0x013229fa, size: 368 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_14 = {};
|
|
const env0_15 = {};
|
|
const env0_16 = {};
|
|
const env0_17 = {};
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun52212(Store);
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{CONNECTION_OPEN: CONNECTION_OPEN_52219, MESSAGE_NOTIFICATION_SHOWN: MESSAGE_NOTIFICATION_SHOWN});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/notifications/LastMentionTimestampStore.tsx');
|
|
exports.default = value;
|
|
exports.trackMessageNotificationTimestamps = trackMessageNotificationTimestamps;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_52209() { // fn#52209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:178, offset: 0x01322b6a, 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_52209_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun52212(a0) { // fn#52212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:429, offset: 0x01322bc8, size: 116 bytes, params: 2, frame: 16
|
|
const closure = LastMentionTimestampStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(GuildMemberStore, UserGuildSettingsStore, UserStore);
|
|
}}, {key: 'getGlobalStats', value: value_52215}, {key: 'getStats', value: value_52217}]);
|
|
}
|
|
|
|
function CONNECTION_OPEN_52219() { // fn#52219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:1708, offset: 0x01322da6, size: 286 bytes, params: 1, frame: 18
|
|
var r3;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var propertyName3;
|
|
var propertyName4;
|
|
var propertyName5;
|
|
const closure = function(a0) {
|
|
var r0;
|
|
var value = a0 != null;
|
|
if (value) {
|
|
value = global.Date.now() - a0;
|
|
value = value < 60000;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
if (closure(env0_10)) {
|
|
}
|
|
if (closure(env0_11)) {
|
|
}
|
|
if (closure(env0_12)) {
|
|
}
|
|
if (closure(env0_13)) {
|
|
}
|
|
for (propertyName in env0_14) {
|
|
if (closure(env0_14[propertyName])) {
|
|
r3 = propertyName2;
|
|
continue;
|
|
}
|
|
delete env0_14[propertyName];
|
|
r3 = propertyName2;
|
|
}
|
|
for (propertyName in env0_15) {
|
|
if (closure(env0_15[propertyName])) {
|
|
r3 = propertyName3;
|
|
continue;
|
|
}
|
|
delete env0_15[propertyName];
|
|
r3 = propertyName3;
|
|
}
|
|
for (propertyName in env0_17) {
|
|
if (closure(env0_17[propertyName])) {
|
|
r3 = propertyName4;
|
|
continue;
|
|
}
|
|
delete env0_17[propertyName];
|
|
r3 = propertyName4;
|
|
}
|
|
for (propertyName in env0_16) {
|
|
if (closure(env0_16[propertyName])) {
|
|
r3 = propertyName5;
|
|
continue;
|
|
}
|
|
delete env0_16[propertyName];
|
|
r3 = propertyName5;
|
|
}
|
|
}
|
|
|
|
function MESSAGE_NOTIFICATION_SHOWN({guildId, mentioned, roleMentioned, everyoneMentioned}) { // fn#52221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:2070, offset: 0x01322ef1, size: 125 bytes, params: 2, frame: 15
|
|
const Date = global.Date;
|
|
const value = Date.now();
|
|
if (guildId != null) {
|
|
env0_14[guildId] = value;
|
|
}
|
|
if (mentioned) {
|
|
if (guildId != null) {
|
|
env0_15[guildId] = value;
|
|
}
|
|
}
|
|
if (roleMentioned) {
|
|
if (guildId != null) {
|
|
env0_17[guildId] = value;
|
|
}
|
|
}
|
|
if (everyoneMentioned) {
|
|
if (guildId != null) {
|
|
env0_16[guildId] = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
function trackMessageNotificationTimestamps(a0, a1) { // fn#52222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:2431, offset: 0x01322f6e, size: 287 bytes, params: 3, frame: 22
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value3 = null;
|
|
const value4 = undefined;
|
|
const id = value3 == currentUser ? value4 : currentUser.id;
|
|
const isSuppressEveryoneEnabled2 = UserGuildSettingsStore.isSuppressEveryoneEnabled(a1);
|
|
const isSuppressRolesEnabled2 = UserGuildSettingsStore.isSuppressRolesEnabled(a1);
|
|
const r8 = value3 != a0.mentions && a0.mentions.some(function({id}) {
|
|
return id === id;
|
|
});
|
|
const r3 = value3 == a1 || value3 == id ? value3 : GuildMemberStore.getMember(a1, id);
|
|
let r6 = value3 != a0.mention_roles && value3 != r3 && value3 != r3.roles && a0.mention_roles.some(_fun52224);
|
|
const value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
const dispatch = value.dispatch;
|
|
r6 = r6 && !isSuppressRolesEnabled2;
|
|
Reflect.apply(dispatch, value, [{type: 'MESSAGE_NOTIFICATION_SHOWN', guildId: a1, mentioned: r8, roleMentioned: r6,
|
|
everyoneMentioned: a0.mention_everyone === true && !isSuppressEveryoneEnabled2}]);
|
|
return value4;
|
|
}
|
|
|
|
function value_52215() { // fn#52215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:845, offset: 0x01322c5f, size: 72 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const closure = function(a0) {
|
|
var r0;
|
|
var Math;
|
|
var value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
Math = global.Math;
|
|
value = global.Date.now() - a0;
|
|
value = Math.floor(value / 1000);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const object2 = {};
|
|
let value = environment.__proto__;
|
|
object2.approx_seconds_since_last_notification = closure(env1_10);
|
|
object2.approx_seconds_since_last_mention = closure(env1_11);
|
|
object2.approx_seconds_since_last_role_mention = closure(env1_12);
|
|
object2.approx_seconds_since_last_everyone_mention = closure(env1_13);
|
|
return object2;
|
|
}
|
|
|
|
function value_52217(a0) { // fn#52217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:1126, offset: 0x01322ce5, size: 193 bytes, params: 2, frame: 16
|
|
var environment;
|
|
const closure = function(a0) {
|
|
var r0;
|
|
var Math;
|
|
var value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
Math = global.Math;
|
|
value = global.Date.now() - a0;
|
|
value = Math.floor(value / 1000);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const object2 = {};
|
|
let value = environment.__proto__;
|
|
object2.approx_seconds_since_last_notification = closure(env1_10);
|
|
object2.approx_seconds_since_last_mention = closure(env1_11);
|
|
object2.approx_seconds_since_last_role_mention = closure(env1_12);
|
|
object2.approx_seconds_since_last_everyone_mention = closure(env1_13);
|
|
const value2 = null;
|
|
object2.approx_seconds_since_last_guild_notification = value2 == a0 ? value2 : closure(env1_14[a0]);
|
|
object2.approx_seconds_since_last_guild_mention = value2 == a0 ? value2 : closure(env1_15[a0]);
|
|
object2.approx_seconds_since_last_guild_role_mention = value2 == a0 ? value2 : closure(env1_17[a0]);
|
|
object2.approx_seconds_since_last_guild_everyone_mention = value2 == a0 ? value2 : closure(env1_16[a0]);
|
|
return object2;
|
|
}
|
|
|
|
function _fun52224(a0) { // fn#52224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6789:2755, offset: 0x0132308d, size: 28 bytes, params: 2, frame: 11
|
|
return env0_1.roles.includes(a0);
|
|
}
|
|
|