679 lines
29 KiB
TypeScript
679 lines
29 KiB
TypeScript
/* Metro module 5220; source: modules/reply_nudge/ReplyNudgeStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 1220, 5221, 1348, 1226, 1379, 4605, 3793, 1934, 4864, 5223, 661, 3, 5219, 1962, 683, 5224, 3829, 566, 694, 2] */
|
|
function _fun46177(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:6, offset: 0x011a1930, size: 713 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_46183 = 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 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 apexExperimentStore = importDefault(1220) /* metro dependency 1220: ApexExperimentStore */;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
let value = require(5223) /* metro dependency 5223: ReplyNudgeConstants */;
|
|
const env0_18 = value.MAX_LATEST_MESSAGE_AGE_MS;
|
|
const env0_19 = value.NUDGE_TIMESTAMP_OFFSET_MS;
|
|
const env0_20 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('ReplyNudgeStore');
|
|
let env0_24 = {};
|
|
let Set = global.Set;
|
|
let set = new Set();
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
|
set = _fun46195(PersistedStore);
|
|
set.displayName = 'ReplyNudgeStore';
|
|
set.persistKey = 'ReplyNudgeStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {REPLY_NUDGE_SET: REPLY_NUDGE_SET_46204,
|
|
REPLY_NUDGE_CLEAR: function({channelId}) {
|
|
return maybeDismissNudge(channelId, 'manual');
|
|
}, REPLY_NUDGES_INITIALIZED: REPLY_NUDGES_INITIALIZED, MESSAGE_CREATE: function({message}) {
|
|
return maybeDismissNudge(message.channel_id, 'message_sent');
|
|
}, MESSAGE_REACTION_ADD: MESSAGE_REACTION_ADD_46209, CHANNEL_SELECT: CHANNEL_SELECT_46210,
|
|
CHANNEL_DELETE: function(a0) {
|
|
return maybeDismissNudge(a0.channel.id, 'channel_deleted');
|
|
}, LOGOUT: function() {
|
|
env0_24 = {};
|
|
var Set = global.Set;
|
|
var value3 = new Set();
|
|
env0_22 = false;
|
|
env0_23 = false;
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/reply_nudge/ReplyNudgeStore.tsx');
|
|
exports.default = set;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_46178() { // fn#46178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:354, offset: 0x011a1bf9, 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_46178_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_46181(a0, a1) { // fn#46181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:547, offset: 0x011a1c57, 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 _fun46182;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_46183(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_46183(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_46183(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun46182;
|
|
}
|
|
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 pruneExpiredNudges(a0, {maxNudgeAge, maxNudgeCount}) { // fn#46184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:1521, offset: 0x011a1dc9, size: 286 bytes, params: 3, frame: 26
|
|
var r5;
|
|
var property;
|
|
var value4;
|
|
var property2;
|
|
var timestamp;
|
|
var isActive;
|
|
var lastMessageId;
|
|
var affinity;
|
|
var authorId;
|
|
var value5;
|
|
var env0_5;
|
|
var env0_6;
|
|
const Date = global.Date;
|
|
const env0_2 = Date.now();
|
|
const object2 = {};
|
|
let Object = global.Object;
|
|
const value = Object.entries(a0);
|
|
value.sort(function(a0, a1) {
|
|
return a1[1].timestamp - a0[1].timestamp;
|
|
});
|
|
const closure = pruneExpiredNudges_loop;
|
|
let length = value.length;
|
|
if (0 < length) {
|
|
for (r5 = 0; true; r5 = value5) {
|
|
property = value[r5];
|
|
value4 = env0_8(property, 2);
|
|
property = value4[0];
|
|
property2 = value4[1];
|
|
timestamp = property2.timestamp;
|
|
env0_5 = timestamp;
|
|
isActive = property2.isActive;
|
|
env0_6 = isActive;
|
|
lastMessageId = property2.lastMessageId;
|
|
affinity = property2.affinity;
|
|
authorId = property2.authorId;
|
|
closure(property, lastMessageId, affinity, authorId);
|
|
value5 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
|
|
length = value.length;
|
|
if (!(value5 < length)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
const binding = env0_21;
|
|
const info = binding.info;
|
|
length = value.length;
|
|
Object = global.Object;
|
|
Reflect.apply(info, binding, ['Pruned ' + (length - Object.keys(object2).length) + ' expired nudges']);
|
|
return object2;
|
|
}
|
|
|
|
function maybeDismissNudge(a0, a1) { // fn#46188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2564, offset: 0x011a2149, size: 183 bytes, params: 3, frame: 15
|
|
var property;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
var value;
|
|
if (a0 in env0_24) {
|
|
property = env0_24[a0];
|
|
if (property.isActive) {
|
|
var env0_3 = global.Date.now() - property.timestamp;
|
|
env0_24[a0].isActive = false;
|
|
var env0_4 = ChannelStore.getChannel(a0);
|
|
value = require(dependencyMap[19]);
|
|
property = dependencyMap[18];
|
|
value = value(property, dependencyMap.paths);
|
|
value.then(_fun46189);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function getActiveNudgeChannelIds() { // fn#46190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3135, offset: 0x011a22f7, size: 109 bytes, params: 1, frame: 19
|
|
var r2;
|
|
var property;
|
|
var value4;
|
|
var isActive;
|
|
var value5;
|
|
const items2 = [];
|
|
const Object = global.Object;
|
|
const value2 = Object.entries(env0_24);
|
|
let length = value2.length;
|
|
const value3 = 0;
|
|
if (value3 < length) {
|
|
r2 = value3;
|
|
while (true) {
|
|
property = value2[r2];
|
|
value4 = env0_8(property, 2);
|
|
property = value4[value3];
|
|
isActive = value4[1].isActive;
|
|
if (isActive) {
|
|
items2.push(property);
|
|
}
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
length = value2.length;
|
|
if (value5 < length) {
|
|
r2 = value5;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function handleNudgeVisibilityChange() { // fn#46191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3285, offset: 0x011a2364, size: 279 bytes, params: 1, frame: 18
|
|
var Set;
|
|
var value5;
|
|
var set;
|
|
const ReplyNudgeExperiment = (require(5224) /* metro dependency 5224: ReplyNudgeExperiment */).ReplyNudgeExperiment;
|
|
const {displayNudges, maxNudgeAge,
|
|
maxNudgeCount} = ReplyNudgeExperiment.getConfig({location: 'handleNudgeVisibilityChange'});
|
|
const EnableDmReplyNudgeReminders = (require(3829) /* metro dependency 3829: UserSettings */).EnableDmReplyNudgeReminders;
|
|
let getSetting = EnableDmReplyNudgeReminders.getSetting;
|
|
const r2 = Reflect.apply(getSetting, EnableDmReplyNudgeReminders, []) !== false && displayNudges;
|
|
if (env0_22 === r2) {
|
|
return false;
|
|
}
|
|
if (r2) {
|
|
env0_24 = pruneExpiredNudges(env0_24, {maxNudgeAge: maxNudgeAge, maxNudgeCount: maxNudgeCount});
|
|
Set = global.Set;
|
|
value5 = getActiveNudgeChannelIds();
|
|
set = new Set();
|
|
}
|
|
getSetting = EnableDmReplyNudgeReminders.getSetting;
|
|
if (Reflect.apply(getSetting, EnableDmReplyNudgeReminders, []) === false) {
|
|
env0_24 = {};
|
|
set = new global.Set();
|
|
}
|
|
}
|
|
|
|
function handleUserGuildSettingsUpdate_46192() { // fn#46192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3721, offset: 0x011a247b, size: 81 bytes, params: 1, frame: 14
|
|
var r3;
|
|
var value3;
|
|
const env0_0 = false;
|
|
const closure = handleUserGuildSettingsUpdate_46192_loop2;
|
|
const Object = global.Object;
|
|
const value = Object.keys(env0_24);
|
|
let length = value.length;
|
|
const value2 = 0;
|
|
if (value2 < length) {
|
|
for (r3 = value2; true; r3 = value3) {
|
|
closure(value[r3]);
|
|
value3 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
|
|
length = value.length;
|
|
if (!(value3 < length)) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return env0_0;
|
|
}
|
|
|
|
function _fun46195(a0) { // fn#46195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4403, offset: 0x011a2678, size: 210 bytes, params: 2, frame: 16
|
|
const closure = ReplyNudgeStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: value_46197}, {key: 'getState', value: value_46198},
|
|
{key: 'getNudgeTimestamp', value: value_46199}, {key: 'getNudgeDMTimestamp', value: value_46200},
|
|
{key: 'isChannelNudged', value: value_46201}, {key: 'getChannelNudge', value: value_46202},
|
|
{key: 'isNudgesInitialized', value: value_46203}]);
|
|
}
|
|
|
|
function REPLY_NUDGE_SET_46204({channelId, timestamp, lastMessageId, affinity, authorId}) { // fn#46204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5761, offset: 0x011a2978, size: 597 bytes, params: 2, frame: 30
|
|
var r12;
|
|
var r13;
|
|
var r14;
|
|
var r10;
|
|
var r16;
|
|
var r17;
|
|
var r4;
|
|
var r6;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var done;
|
|
var value8;
|
|
var value9;
|
|
var property;
|
|
var affinity2;
|
|
var affinity3;
|
|
var value10;
|
|
var env0_0;
|
|
var env0_2;
|
|
if (UserGuildSettingsStore.isChannelMuted(null, channelId)) {
|
|
return false;
|
|
}
|
|
const ReplyNudgeExperiment = require(dependencyMap[21]).ReplyNudgeExperiment;
|
|
const {maxNudgeAge, maxNudgeCount} = ReplyNudgeExperiment.getConfig({location: 'handleReplyNudgeSet'});
|
|
const pruneExpiredNudgesBinding = pruneExpiredNudges;
|
|
let binding = env0_24;
|
|
const value3 = pruneExpiredNudgesBinding(binding, {maxNudgeAge: maxNudgeAge, maxNudgeCount: maxNudgeCount});
|
|
env0_24 = value3;
|
|
if (channelId in value3) {
|
|
return false;
|
|
}
|
|
const activeNudgeChannelIds = getActiveNudgeChannelIds();
|
|
if (activeNudgeChannelIds.length >= maxNudgeCount) {
|
|
value5 = activeNudgeChannelIds.at(-1);
|
|
value6 = _createForOfIteratorHelperLoose_46181(activeNudgeChannelIds);
|
|
value7 = value6();
|
|
done = value7.done;
|
|
value8 = Infinity;
|
|
if (done) {
|
|
r4 = value8;
|
|
r6 = value5;
|
|
} else {
|
|
r12 = value8;
|
|
r13 = value5;
|
|
r14 = value7;
|
|
while (true) {
|
|
value9 = r14.value;
|
|
property = env0_24[value9];
|
|
if (property == null) {
|
|
r16 = r12;
|
|
r17 = r13;
|
|
} else {
|
|
affinity2 = property.affinity;
|
|
if (!(affinity2 < r12)) {
|
|
r10 = r12;
|
|
continue;
|
|
}
|
|
affinity3 = property.affinity;
|
|
env0_0 = value9;
|
|
r10 = affinity3;
|
|
r13 = value9;
|
|
r16 = r10;
|
|
r17 = r13;
|
|
}
|
|
value10 = value6();
|
|
done = value10.done;
|
|
if (done) {
|
|
r4 = r16;
|
|
r6 = r17;
|
|
break;
|
|
}
|
|
r12 = r16;
|
|
r13 = r17;
|
|
r14 = value10;
|
|
continue;
|
|
}
|
|
}
|
|
if (affinity < r4) {
|
|
binding = env0_21;
|
|
binding.info('handleReplyNudgeSet: New nudge is lower than the lowest affinity. No space to nudge.',
|
|
{channelId: channelId, lowestAffinity: r4, newNudgeAffinity: affinity});
|
|
return false;
|
|
}
|
|
binding = env0_21;
|
|
binding.info('handleReplyNudgeSet: Evicting nudge with lowest affinity', {channelId: channelId,
|
|
lowestAffinity: r4,
|
|
newNudgeAffinity: affinity});
|
|
property = env0_24[r6];
|
|
if (property != null) {
|
|
if (property.isActive) {
|
|
env0_2 = ChannelStore.getChannel(r6);
|
|
require(dependencyMap[19])(dependencyMap[18], dependencyMap.paths).then(_fun46205);
|
|
}
|
|
}
|
|
delete env0_24[r6];
|
|
binding = env0_24;
|
|
binding[channelId] = {timestamp: timestamp, isActive: true, lastMessageId: lastMessageId, affinity: affinity,
|
|
authorId: authorId};
|
|
binding = env0_25;
|
|
binding.add(channelId);
|
|
} else {
|
|
binding = env0_24;
|
|
binding[channelId] = {timestamp: timestamp, isActive: true, lastMessageId: lastMessageId, affinity: affinity,
|
|
authorId: authorId};
|
|
binding = env0_25;
|
|
binding.add(channelId);
|
|
}
|
|
}
|
|
|
|
function REPLY_NUDGES_INITIALIZED() { // fn#46207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7271, offset: 0x011a2cfe, size: 115 bytes, params: 1, frame: 16
|
|
if (env0_23) {
|
|
return false;
|
|
}
|
|
const ReplyNudgeExperiment = (require(5224) /* metro dependency 5224: ReplyNudgeExperiment */).ReplyNudgeExperiment;
|
|
const config = ReplyNudgeExperiment.getConfig({location: 'handleNudgesInitialized'});
|
|
env0_24 = pruneExpiredNudges(env0_24, {maxNudgeAge: config.maxNudgeAge, maxNudgeCount: config.maxNudgeCount});
|
|
}
|
|
|
|
function MESSAGE_REACTION_ADD_46209({channelId, userId}) { // fn#46209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7634, offset: 0x011a2d95, size: 57 bytes, params: 2, frame: 14
|
|
const getId = AuthenticationStore.getId;
|
|
return userId === Reflect.apply(getId, AuthenticationStore, []) && maybeDismissNudge(channelId, 'reaction_added');
|
|
}
|
|
|
|
function CHANNEL_SELECT_46210({guildId, channelId}) { // fn#46210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:7768, offset: 0x011a2dce, size: 55 bytes, params: 2, frame: 15
|
|
return channelId != null && (guildId == null && maybeDismissNudge(channelId, 'channel_opened'));
|
|
}
|
|
|
|
function pruneExpiredNudges_loop(a0, a1, a2, a3) { // fn#46186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:1691, owner: pruneExpiredNudges._loop, offset: 0x011a1f0a, size: 356 bytes, params: 5, frame: 22
|
|
var environment;
|
|
var r10;
|
|
var r6;
|
|
var r4;
|
|
var r3;
|
|
var binding;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
var value;
|
|
if (timestamp != null) {
|
|
binding = env0_2;
|
|
value2 = binding - timestamp;
|
|
value3 = environment.__proto__;
|
|
if (value2 < MAX_LATEST_MESSAGE_AGE_MS) {
|
|
binding = env0_2;
|
|
value4 = binding - timestamp;
|
|
var env0_4 = value4;
|
|
value5 = ReadStateStore.lastMessageId(a0);
|
|
r10 = isActive && value4 >= maxNudgeAge;
|
|
r6 = isActive && env0_4 >= maxNudgeCount;
|
|
r4 = isActive && value5 !== a1;
|
|
r3 = isActive && !r10;
|
|
r3 = r3 && !r6;
|
|
r3 = r3 && !r4;
|
|
if (!r10) {
|
|
if (!r6) {
|
|
if (r4) {
|
|
}
|
|
}
|
|
}
|
|
binding = env0_3;
|
|
binding[a0] = {timestamp: timestamp, isActive: r3, lastMessageId: a1, affinity: a2, authorId: a3};
|
|
if (r3) {
|
|
binding = env0_4;
|
|
env0_4 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
} else if (isActive) {
|
|
var env0_6 = ChannelStore.getChannel(a0);
|
|
value = require(dependencyMap[19]);
|
|
value = value(dependencyMap[18], dependencyMap.paths);
|
|
value.then(_fun46187);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun46189({default: property}) { // fn#46189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2759, offset: 0x011a2200, size: 247 bytes, params: 2, frame: 20
|
|
const value = environment.__proto__;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
|
|
const object2 = {};
|
|
object2.channel_id = env0_0;
|
|
object2.channel_type = env0_4?.type;
|
|
object2.guild_id = env0_4?.guild_id;
|
|
object2.dismiss_method = require;
|
|
object2.nudge_age_ms = env0_3;
|
|
object2.nudge_author_affinity = env0_2.affinity;
|
|
object2.nudge_author_id = env0_2.authorId;
|
|
object2.nudge_message_id = env0_2.lastMessageId;
|
|
object2.nudge_author_is_friend = RelationshipStore.isFriend(env0_2.authorId);
|
|
object2.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
|
|
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object2]);
|
|
}
|
|
|
|
function handleUserGuildSettingsUpdate_46192_loop2(a0) { // fn#46193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3782, owner: handleUserGuildSettingsUpdate_46192._loop2, offset: 0x011a24cc, size: 152 bytes, params: 2, frame: 16
|
|
var property;
|
|
const env0_0 = a0;
|
|
if (UserGuildSettingsStore.isChannelMuted(null, a0)) {
|
|
property = env1_24[a0];
|
|
if (property != null) {
|
|
if (property.isActive) {
|
|
var env0_2 = ChannelStore.getChannel(a0);
|
|
require(dependencyMap[19])(dependencyMap[18], dependencyMap.paths).then(_fun46194);
|
|
}
|
|
}
|
|
delete env1_24[a0];
|
|
}
|
|
}
|
|
|
|
function value_46197(a0) { // fn#46197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4708, offset: 0x011a27bb, size: 151 bytes, params: 2, frame: 29
|
|
const value = undefined;
|
|
env1_24 = (a0 == null ? value : a0.nudgedChannels) ?? ({});
|
|
this.waitFor(ApexExperimentStore, AuthenticationStore, ChannelStore, ReadStateStore, RelationshipStore,
|
|
SelectedChannelStore, UserAffinitiesV2Store, UserGuildSettingsStore, UserSettingsProtoStore);
|
|
this.syncWith([UserSettingsProtoStore, ApexExperimentStore], handleNudgeVisibilityChange);
|
|
this.syncWith([UserGuildSettingsStore], handleUserGuildSettingsUpdate_46192);
|
|
return value;
|
|
}
|
|
|
|
function value_46198() { // fn#46198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:4940, offset: 0x011a2852, size: 16 bytes, params: 1, frame: 2
|
|
return {nudgedChannels: env1_24};
|
|
}
|
|
|
|
function value_46199(a0) { // fn#46199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5018, offset: 0x011a2862, size: 93 bytes, params: 2, frame: 14
|
|
var property;
|
|
const value2 = null;
|
|
if (env1_22) {
|
|
property = env1_24[a0];
|
|
return value2 == property ? value2 : (property.isActive || env1_25.has(a0)) && value2 != env1_24[a0].timestamp ? env1_24[a0].timestamp : value2;
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function value_46200(a0) { // fn#46200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5190, offset: 0x011a28bf, size: 39 bytes, params: 2, frame: 11
|
|
var r0;
|
|
var value3;
|
|
let value = this.getNudgeTimestamp(a0);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r0 = value2;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
value += NUDGE_TIMESTAMP_OFFSET_MS;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_46201(a0) { // fn#46201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5309, offset: 0x011a28e6, size: 81 bytes, params: 2, frame: 5
|
|
let value = a1;
|
|
const value2 = undefined;
|
|
let includeInvisible = (value !== value2 ? value : {}).includeInvisible;
|
|
includeInvisible = !(includeInvisible === value2) && includeInvisible;
|
|
value = environment.__proto__;
|
|
return !(!env1_22 && !includeInvisible) && (env1_24[a0] == null ? value2 : env1_24[a0].isActive) === true;
|
|
}
|
|
|
|
function value_46202(a0) { // fn#46202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:5458, offset: 0x011a2937, size: 65 bytes, params: 2, frame: 4
|
|
let value = a1;
|
|
let includeInvisible = (value !== undefined ? value : {}).includeInvisible;
|
|
includeInvisible = !(includeInvisible === undefined) && includeInvisible;
|
|
value = environment.__proto__;
|
|
return env1_22 || includeInvisible ? env1_24[a0] ?? null : null;
|
|
}
|
|
|
|
function _fun46205({default: property}) { // fn#46205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:6642, offset: 0x011a2bcd, size: 276 bytes, params: 2, frame: 20
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
|
|
const object2 = {};
|
|
object2.channel_id = value;
|
|
object2.channel_type = env0_2?.type;
|
|
object2.guild_id = env0_2?.guild_id;
|
|
object2.dismiss_method = 'evicted_affinity';
|
|
const Date = global.Date;
|
|
object2.nudge_age_ms = Date.now() - env0_1.timestamp;
|
|
object2.nudge_author_affinity = env0_1.affinity;
|
|
object2.nudge_author_id = env0_1.authorId;
|
|
object2.nudge_message_id = env0_1.lastMessageId;
|
|
object2.nudge_author_is_friend = RelationshipStore.isFriend(env0_1.authorId);
|
|
const privateChannelIds = property.getPrivateChannelIds();
|
|
object2.channel_dm_list_index = privateChannelIds.indexOf(value);
|
|
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object2]);
|
|
}
|
|
|
|
function _fun46187({default: property}) { // fn#46187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:2022, offset: 0x011a206e, size: 219 bytes, params: 2, frame: 20
|
|
const value = environment.__proto__.__proto__;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
|
|
const object2 = {};
|
|
object2.channel_id = env0_0;
|
|
object2.channel_type = env0_6?.type;
|
|
object2.guild_id = env0_6?.guild_id;
|
|
object2.dismiss_method = env0_5;
|
|
object2.nudge_age_ms = env0_4;
|
|
object2.nudge_author_affinity = importDefault;
|
|
object2.nudge_author_id = importAll;
|
|
object2.nudge_author_is_friend = RelationshipStore.isFriend(importAll);
|
|
object2.nudge_message_id = require;
|
|
object2.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
|
|
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object2]);
|
|
}
|
|
|
|
function _fun46194({default: property}) { // fn#46194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5398:3911, offset: 0x011a2564, size: 276 bytes, params: 2, frame: 20
|
|
const value = environment.__proto__.__proto__;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const REPLY_NUDGE_DISMISSED = AnalyticEvents.REPLY_NUDGE_DISMISSED;
|
|
const object2 = {};
|
|
object2.channel_id = env0_0;
|
|
object2.channel_type = env0_2?.type;
|
|
object2.guild_id = env0_2?.guild_id;
|
|
object2.dismiss_method = 'channel_muted';
|
|
const Date = global.Date;
|
|
object2.nudge_age_ms = Date.now() - env0_1.timestamp;
|
|
object2.nudge_author_affinity = env0_1.affinity;
|
|
object2.nudge_author_id = env0_1.authorId;
|
|
object2.nudge_message_id = env0_1.lastMessageId;
|
|
object2.nudge_author_is_friend = RelationshipStore.isFriend(env0_1.authorId);
|
|
object2.channel_dm_list_index = property.getPrivateChannelIds().indexOf(env0_0);
|
|
Reflect.apply(track, defaultImport, [REPLY_NUDGE_DISMISSED, object2]);
|
|
}
|
|
|