4969 lines
211 KiB
TypeScript
4969 lines
211 KiB
TypeScript
/* Metro module 4605; source: stores/ReadStateStore.tsx; dependencies: [15, 17, 18, 5, 57, 6, 7, 1378, 4606, 1936, 4107, 4117, 4621, 4622, 4623, 4790, 3786, 1348, 1383, 1226, 4791, 1379, 4794, 4646, 1867, 4795, 4814, 3784, 3793, 1934, 4864, 1878, 12367, 661, 8044, 1386, 1385, 4865, 1243, 3, 12368, 12369, 21, 672, 694, 4639, 12370, 507, 4041, 9493, 10915, 3792, 12371, 5102, 5214, 12372, 1962, 1391, 3738, 22, 1360, 4819, 4008, 10914, 3791, 1392, 7030, 8876, 566, 2] */
|
|
function _fun39147(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:6, offset: 0x010d9339, size: 2313 bytes, params: 8, frame: 36
|
|
var object2;
|
|
var isOverlayChannelVisible;
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_39153 = 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 closure = DECAY_READ_STATES;
|
|
const parseTimestamp = function(a0) {
|
|
if (a0 == null) {
|
|
return 0;
|
|
}
|
|
var Date = global.Date;
|
|
var value = Date.parse(a0);
|
|
return (0, global.isNaN)(value) ? 0 : value;
|
|
};
|
|
const closure2 = shouldBadgeMessage;
|
|
const processBulkAckQueue = function() {
|
|
return _processBulkAckQueue.apply(this, arguments);
|
|
};
|
|
const mergeChannels = function(a0) {
|
|
a0.forEach(_fun39169);
|
|
};
|
|
const mergeServerChannels = function(a0) {
|
|
a0.forEach(_fun39171);
|
|
};
|
|
const mergeRelationships = function(a0) {
|
|
_fun39178(a0);
|
|
};
|
|
const closure3 = LOGOUT_39186;
|
|
const closure4 = MESSAGE_DELETE;
|
|
const closure5 = function({threads}) {
|
|
mergeServerChannels(threads);
|
|
};
|
|
const closure6 = function({data}) {
|
|
data.forEach(_fun39191);
|
|
};
|
|
const closure7 = CHANNEL_DELETE_39195;
|
|
const closure8 = MESSAGE_ACK_39199;
|
|
const closure9 = function({id, ackType, ackedId, local}) {
|
|
return handleNonChannelAck(id, ackType, ackedId, local);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_4 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_5 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_6 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_7 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_8 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_9 = importDefault(7) /* metro dependency 7 */;
|
|
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
|
|
const channelRTCStore = importDefault(4606) /* metro dependency 4606: ChannelRTCStore */;
|
|
const gatedChannelStore = importDefault(1936) /* metro dependency 1936: GatedChannelStore */;
|
|
const experimentStore = importDefault(4107) /* metro dependency 4107: ExperimentStore */;
|
|
const guildScheduledEventStore = importDefault(4117) /* metro dependency 4117: GuildScheduledEventStore */;
|
|
const env0_15 = (require(4117) /* metro dependency 4117: GuildScheduledEventStore */).isEventUpcoming;
|
|
const messageRequestStore = importDefault(4621) /* metro dependency 4621: MessageRequestStore */;
|
|
const spamMessageRequestStore = importDefault(4622) /* metro dependency 4622: SpamMessageRequestStore */;
|
|
const notificationCenterItemsStore = importDefault(4623) /* metro dependency 4623: NotificationCenterItemsStore */;
|
|
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
|
|
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
|
|
const env0_22 = value.isReadableType;
|
|
const env0_23 = value.isThread;
|
|
const env0_24 = value.isPrivate;
|
|
const env0_25 = value.ALL_CHANNEL_TYPES;
|
|
const env0_26 = value.THREAD_CHANNEL_TYPES;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelSectionStore = importDefault(4791) /* metro dependency 4791: ChannelSectionStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const dimensionStore = importDefault(4794) /* metro dependency 4794: DimensionStore */;
|
|
const guildAvailabilityStore = importDefault(4646) /* metro dependency 4646: GuildAvailabilityStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const idleStore = importDefault(4795) /* metro dependency 4795: IdleStore */;
|
|
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
value = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const windowStore = importDefault(12367) /* metro dependency 12367: WindowStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_41 = constantsModule.AnalyticsObjectTypes;
|
|
const env0_42 = constantsModule.AnalyticsObjects;
|
|
const env0_43 = constantsModule.AnalyticsSections;
|
|
const env0_44 = constantsModule.Endpoints;
|
|
const env0_45 = constantsModule.ChannelLayouts;
|
|
constantsModule.OverlayWidgets;
|
|
const env0_46 = constantsModule.CURRENT_APP_CONTEXT;
|
|
const env0_47 = constantsModule.ChannelTypes;
|
|
const BasicPermissions = constantsModule.BasicPermissions;
|
|
const env0_49 = constantsModule.Permissions;
|
|
const env0_50 = constantsModule.MessageTypes;
|
|
const env0_51 = constantsModule.RelationshipTypes;
|
|
const env0_52 = constantsModule.ChannelTypesSets;
|
|
const env0_53 = constantsModule.UserNotificationSettings;
|
|
const env0_54 = constantsModule.MessageTypesSets;
|
|
const env0_55 = constantsModule.AppStates;
|
|
const activityPanelConstantsModule = require(8044) /* metro dependency 8044: ActivityPanelConstants */;
|
|
const env0_56 = activityPanelConstantsModule.ActivityPanelModes;
|
|
const env0_57 = activityPanelConstantsModule.FocusedActivityLayouts;
|
|
const channelConstantsModule = require(1386) /* metro dependency 1386: ChannelConstants */;
|
|
const env0_58 = channelConstantsModule.ChannelFlags;
|
|
const env0_59 = channelConstantsModule.isStaticChannelRoute;
|
|
const env0_60 = (require(1385) /* metro dependency 1385: GuildScheduledEventsConstants */).GuildScheduledEventStatus;
|
|
const env0_61 = (require(4865) /* metro dependency 4865: ReadStateConstants */).ReadStateTypes;
|
|
const env0_62 = (require(1243) /* metro dependency 1243: ThreadConstants */).ThreadMemberFlags;
|
|
const value7 = new (importDefault(3) /* metro dependency 3: Logger */)('ReadStateStore');
|
|
const env0_64 = function() {
|
|
return false;
|
|
};
|
|
if ((require(12368) /* metro dependency 12368: OverlaySupported */).OVERLAY_SUPPORTED) {
|
|
isOverlayChannelVisible = (require(12369) /* metro dependency 12369: OverlayVisibilityNative */).isOverlayChannelVisible;
|
|
}
|
|
const VIEW_CHANNEL = BasicPermissions.VIEW_CHANNEL;
|
|
const READ_MESSAGE_HISTORY = BasicPermissions.READ_MESSAGE_HISTORY;
|
|
const env0_65 = VIEW_CHANNEL | READ_MESSAGE_HISTORY;
|
|
const env0_66 = value.getChannelId();
|
|
const env0_70 = [];
|
|
value = _fun39203();
|
|
value = new value();
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const DAY = Millis.DAY;
|
|
const env0_74 = 30 * DAY;
|
|
object2 = {IS_GUILD_CHANNEL: 1};
|
|
object2[1] = 'IS_GUILD_CHANNEL';
|
|
object2.IS_THREAD = 2;
|
|
object2[2] = 'IS_THREAD';
|
|
object2.IS_MENTION_LOW_IMPORTANCE = 4;
|
|
object2[4] = 'IS_MENTION_LOW_IMPORTANCE';
|
|
value = _fun39213();
|
|
value._guildReadStateSentinels = {};
|
|
const Map = global.Map;
|
|
const value10 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map();
|
|
value._readStates = map instanceof Object ? map : value10;
|
|
const Set = global.Set;
|
|
const value12 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set();
|
|
value._mentionChannels = set instanceof Object ? set : value12;
|
|
const env0_80 = (require(22) /* metro dependency 22 */).throttle(function(a0) {
|
|
a0.delete();
|
|
}, 100);
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
const value15 = _fun39279(Store);
|
|
value15.displayName = 'ReadStateStore';
|
|
const value18 = new value15(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{BACKGROUND_SYNC_CHANNEL_MESSAGES: BACKGROUND_SYNC_CHANNEL_MESSAGES, CONNECTION_OPEN: CONNECTION_OPEN_39332,
|
|
CONNECTION_OPEN_SUPPLEMENTAL: function({lazyPrivateChannels}) {
|
|
mergeChannels(lazyPrivateChannels);
|
|
}, LOGOUT: closure3, OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_39336, CACHE_LOADED: function({readStates}) {
|
|
env0_69 = true;
|
|
DECAY_READ_STATES();
|
|
readStates.forEach(_fun39339);
|
|
}, GUILD_CREATE: GUILD_CREATE_39340, LOAD_MESSAGES_SUCCESS: LOAD_MESSAGES_SUCCESS_39342,
|
|
LOCAL_MESSAGES_LOADED: LOCAL_MESSAGES_LOADED_39344, MESSAGE_CREATE: MESSAGE_CREATE_39345,
|
|
MESSAGE_DELETE: closure4, MESSAGE_DELETE_BULK: closure4, MESSAGE_ACK: closure8, CHANNEL_ACK: CHANNEL_ACK_39346,
|
|
CHANNEL_LOCAL_ACK: CHANNEL_LOCAL_ACK, CHANNEL_PINS_ACK: CHANNEL_PINS_ACK,
|
|
CHANNEL_PINS_UPDATE: CHANNEL_PINS_UPDATE, CHANNEL_SELECT: CHANNEL_SELECT_39350,
|
|
OVERLAY_TEXT_CHAT_ACK_CHANNEL: OVERLAY_TEXT_CHAT_ACK_CHANNEL, VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_39352,
|
|
CHANNEL_CREATE: CHANNEL_CREATE_39353, THREAD_CREATE: THREAD_CREATE_39354, THREAD_UPDATE: THREAD_UPDATE,
|
|
THREAD_LIST_SYNC: function({threads}) {
|
|
threads.forEach(_fun39357);
|
|
}, LOAD_THREADS_SUCCESS: closure5, LOAD_ARCHIVED_THREADS_SUCCESS: closure5, SEARCH_MESSAGES_SUCCESS: closure6,
|
|
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure6, THREAD_MEMBER_UPDATE: THREAD_MEMBER_UPDATE_39358,
|
|
THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_39359, CHANNEL_DELETE: closure7, THREAD_DELETE: closure7,
|
|
WINDOW_FOCUS: WINDOW_FOCUS, UPDATE_CHANNEL_DIMENSIONS: function({channelId, timestamp}) {
|
|
return tryAck({section: AnalyticsSections.CHANNEL, object: AnalyticsObjects.ACK_CHANNEL_SCROLL,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}, channelId, timestamp);
|
|
}, CURRENT_USER_UPDATE: function() {
|
|
env0_68 = null;
|
|
}, BULK_ACK: function({channels, context, onFinished}) {
|
|
_fun39365(channels.filter(_fun39368), context, onFinished);
|
|
}, ENABLE_AUTOMATIC_ACK: function(a0) {
|
|
a0.channelId;
|
|
a0.windowId;
|
|
return false;
|
|
}, DISABLE_AUTOMATIC_ACK: function(a0) {
|
|
a0.channelId;
|
|
a0.windowId;
|
|
return false;
|
|
}, GUILD_FEATURE_ACK: closure9, GUILD_SCHEDULED_EVENT_CREATE: GUILD_SCHEDULED_EVENT_CREATE_39371,
|
|
GUILD_SCHEDULED_EVENT_UPDATE: GUILD_SCHEDULED_EVENT_UPDATE,
|
|
GUILD_SCHEDULED_EVENT_DELETE: GUILD_SCHEDULED_EVENT_DELETE_39373, GUILD_DELETE: GUILD_DELETE_39374,
|
|
GUILD_UPDATE: GUILD_UPDATE_39375, RESORT_THREADS: function({channelId}) {
|
|
return tryAck({section: AnalyticsSections.CHANNEL, object: AnalyticsObjects.ACK_RESORT_THREADS,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}, channelId);
|
|
}, CHANNEL_RTC_UPDATE_CHAT_OPEN: CHANNEL_RTC_UPDATE_CHAT_OPEN, DECAY_READ_STATES: closure,
|
|
NOTIFICATION_CENTER_ITEM_CREATE: NOTIFICATION_CENTER_ITEM_CREATE, RELATIONSHIP_ADD: RELATIONSHIP_ADD_39379,
|
|
RELATIONSHIP_REMOVE: RELATIONSHIP_REMOVE_39380, NOTIFICATION_CENTER_ITEMS_ACK: NOTIFICATION_CENTER_ITEMS_ACK,
|
|
USER_NON_CHANNEL_ACK: USER_NON_CHANNEL_ACK_39383, PASSIVE_UPDATE_V2: PASSIVE_UPDATE_V2_39384,
|
|
CLEAR_OLDEST_UNREAD_MESSAGE: function({channelId}) {
|
|
return clearOldestUnreadMessageId(channelId);
|
|
}, TRY_ACK: function({channelId, location}) {
|
|
return tryAck(location, channelId);
|
|
}, MESSAGE_REQUEST_ACK: MESSAGE_REQUEST_ACK, MESSAGE_REQUEST_CLEAR_ACK: MESSAGE_REQUEST_CLEAR_ACK,
|
|
APP_STATE_UPDATE: APP_STATE_UPDATE_39389});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('stores/ReadStateStore.tsx');
|
|
exports.default = value18;
|
|
exports.shouldBadgeMessage = closure2;
|
|
exports.ReadState = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_39148() { // fn#39148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:1138, offset: 0x010d9c42, 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_39148_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_39151(a0, a1) { // fn#39151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:1331, offset: 0x010d9ca0, 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 _fun39152;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_39153(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_39153(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_39153(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun39152;
|
|
}
|
|
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 generateOldThreadCutoff() { // fn#39154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:3974, offset: 0x010d9e12, size: 63 bytes, params: 1, frame: 13
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const fromTimestamp = defaultImport.fromTimestamp;
|
|
const Date = global.Date;
|
|
return Reflect.apply(fromTimestamp, defaultImport, [Date.now() - env0_74]);
|
|
}
|
|
|
|
function DECAY_READ_STATES() { // fn#39155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4076, offset: 0x010d9e51, size: 188 bytes, params: 1, frame: 18
|
|
let Date = global.Date;
|
|
let value = Date.now();
|
|
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
let DAY = Millis.DAY;
|
|
env0_75 = value - 7 * DAY;
|
|
Date = global.Date;
|
|
value = Date.now();
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
DAY = Millis.DAY;
|
|
env0_76 = value - 3 * DAY;
|
|
global.clearTimeout(env0_77);
|
|
const setTimeout = global.setTimeout;
|
|
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const HOUR = Millis.HOUR;
|
|
env0_77 = setTimeout(_fun39156, 1 * HOUR);
|
|
}
|
|
|
|
function shouldBadgeMessage(a0, a1) { // fn#39158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4380, offset: 0x010d9f73, size: 188 bytes, params: 3, frame: 18
|
|
var r1;
|
|
var r0;
|
|
var isBlockedOrIgnoredForMessage2;
|
|
var defaultImport;
|
|
var object2;
|
|
var isSuppressEveryoneEnabled;
|
|
var guild_id;
|
|
var isSuppressRolesEnabled;
|
|
var value5;
|
|
const channel = ChannelStore.getChannel(a0.channel_id);
|
|
const value3 = channel != null;
|
|
if (value3) {
|
|
isBlockedOrIgnoredForMessage2 = RelationshipStore.isBlockedOrIgnoredForMessage(a0);
|
|
if (isBlockedOrIgnoredForMessage2) {
|
|
r1 = !isBlockedOrIgnoredForMessage2;
|
|
} else {
|
|
defaultImport = importDefault(4639) /* metro dependency 4639: isMessageMentioned */;
|
|
object2 = {message: a0};
|
|
object2.userId = a1.id;
|
|
isSuppressEveryoneEnabled = UserGuildSettingsStore.isSuppressEveryoneEnabled;
|
|
guild_id = channel.guild_id;
|
|
object2.suppressEveryone = Reflect.apply(isSuppressEveryoneEnabled, UserGuildSettingsStore, [guild_id]);
|
|
isSuppressRolesEnabled = UserGuildSettingsStore.isSuppressRolesEnabled;
|
|
guild_id = channel.guild_id;
|
|
object2.suppressRoles = Reflect.apply(isSuppressRolesEnabled, UserGuildSettingsStore, [guild_id]);
|
|
value5 = defaultImport(object2);
|
|
r1 = value5 ? !!value5 : !!isNonMutedPrivateMessage(channel);
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isNonMutedPrivateMessage(a0) { // fn#39159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4677, offset: 0x010da02f, size: 59 bytes, params: 2, frame: 14
|
|
return a0 != null && a0.isPrivate() && !UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(a0.guild_id, a0.id);
|
|
}
|
|
|
|
function _processBulkAckQueue() { // fn#39161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4878, offset: 0x010da088, size: 48 bytes, params: 1, frame: 14
|
|
return env0_6(_fun39163).apply(this, arguments);
|
|
}
|
|
|
|
function isOverlayAckable(a0, a1) { // fn#39165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:5278, offset: 0x010da203, size: 28 bytes, params: 3, frame: 12
|
|
return a1 != null && isOverlayChannelVisible(a1);
|
|
}
|
|
|
|
function staffLog(a0, a1) { // fn#39166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:5352, offset: 0x010da21f, size: 76 bytes, params: 3, frame: 15
|
|
var binding;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser != null && currentUser.hasAnyStaffLevel()) {
|
|
binding = env0_63;
|
|
binding.log('STAFF-ACK-LOG:', a1, a0.channelId);
|
|
}
|
|
}
|
|
|
|
function shouldAutomaticallyAck(a0, a1) { // fn#39167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:5472, offset: 0x010da26b, size: 764 bytes, params: 3, frame: 19
|
|
var r1;
|
|
var r6;
|
|
var isForumPost;
|
|
var isForumPost2;
|
|
var getFocusedLayout;
|
|
var value6;
|
|
var NO_CHAT;
|
|
var isForumLikeChannel;
|
|
var isForumLikeChannel2;
|
|
var value7;
|
|
var isForumLikeChannel3;
|
|
var isAtBottom;
|
|
var getLayout;
|
|
var value9;
|
|
var getChatOpen;
|
|
var FULL_SCREEN;
|
|
var getMessages;
|
|
var value10;
|
|
var ready;
|
|
var loadingMore;
|
|
var moduleValue;
|
|
var isChannelFocusedForReadStateAck;
|
|
var isChannelFocusedForReadStateAck2;
|
|
let value = environment;
|
|
let staffLogBinding = staffLog;
|
|
const value2 = undefined;
|
|
staffLogBinding(a0, 'shouldAutomaticallyAck called');
|
|
const type = a0.type;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type !== CHANNEL) {
|
|
staffLog(a0, 'not channel read state');
|
|
} else {
|
|
var getChannel = ChannelStore.getChannel;
|
|
var channelId = a0.channelId;
|
|
var value3 = Reflect.apply(getChannel, ChannelStore, [channelId]);
|
|
var value4 = value3 != null;
|
|
reducibleJoin3: while (true) {
|
|
if (value4) {
|
|
isForumPost = value3.isForumPost;
|
|
isForumPost2 = Reflect.apply(isForumPost, value3, []);
|
|
r1 = isForumPost2;
|
|
break reducibleJoin3;
|
|
}
|
|
r1 = value4;
|
|
break reducibleJoin3;
|
|
}
|
|
var getConnectedActivityLocation = EmbeddedActivitiesStore.getConnectedActivityLocation;
|
|
if (Reflect.apply(getConnectedActivityLocation, EmbeddedActivitiesStore, []) != null) {
|
|
reducibleJoin6: while (true) {
|
|
if (EmbeddedActivitiesStore.getActivityPanelMode() !== ActivityPanelModes.PANEL) {
|
|
break reducibleJoin6;
|
|
}
|
|
getFocusedLayout = EmbeddedActivitiesStore.getFocusedLayout;
|
|
value6 = Reflect.apply(getFocusedLayout, EmbeddedActivitiesStore, []);
|
|
NO_CHAT = FocusedActivityLayouts.NO_CHAT;
|
|
if (value6 === NO_CHAT) {
|
|
staffLog(a0, 'In activity');
|
|
return false;
|
|
}
|
|
break reducibleJoin6;
|
|
}
|
|
}
|
|
if (IdleStore.isIdle()) {
|
|
staffLog(a0, 'Is idle');
|
|
return false;
|
|
}
|
|
if (a0.canTrackUnreads()) {
|
|
reducibleJoin11: while (true) {
|
|
if (value3 == null) {
|
|
r6 = value2;
|
|
break reducibleJoin11;
|
|
}
|
|
isForumLikeChannel = value3.isForumLikeChannel;
|
|
isForumLikeChannel2 = Reflect.apply(isForumLikeChannel, value3, []);
|
|
r6 = isForumLikeChannel2;
|
|
break reducibleJoin11;
|
|
}
|
|
value7 = true;
|
|
if (value7 !== r6) {
|
|
reducibleJoin13: while (true) {
|
|
if ((importDefault(9493) /* metro dependency 9493: DiscordAppStateNative */).getState() !== AppStates.ACTIVE) {
|
|
staffLog(a0, 'App not active');
|
|
return false;
|
|
}
|
|
break reducibleJoin13;
|
|
}
|
|
}
|
|
if (r1) {
|
|
reducibleJoin16: while (true) {
|
|
if (!a0._persisted) {
|
|
staffLog(a0, 'unpersisted forum post');
|
|
return value7;
|
|
}
|
|
break reducibleJoin16;
|
|
}
|
|
}
|
|
if (a0.hasUnreadOrMentions()) {
|
|
reducibleJoin20: while (true) {
|
|
if (value3 == null) {
|
|
r6 = value2;
|
|
break reducibleJoin20;
|
|
}
|
|
isForumLikeChannel = value3.isForumLikeChannel;
|
|
isForumLikeChannel3 = Reflect.apply(isForumLikeChannel, value3, []);
|
|
r6 = isForumLikeChannel3;
|
|
break reducibleJoin20;
|
|
}
|
|
if (value7 === r6) {
|
|
staffLog(a0, 'Forum-like channel');
|
|
return false;
|
|
}
|
|
if (r1) {
|
|
reducibleJoin23: while (true) {
|
|
if (!a0._isJoinedThread) {
|
|
getLayout = ChannelRTCStore.getLayout;
|
|
channelId = a0.channelId;
|
|
value9 = Reflect.apply(getLayout, ChannelRTCStore, [channelId]);
|
|
getChatOpen = ChannelRTCStore.getChatOpen;
|
|
channelId = a0.channelId;
|
|
if (!Reflect.apply(getChatOpen, ChannelRTCStore, [channelId])) {
|
|
NO_CHAT = ChannelLayouts.NO_CHAT;
|
|
reducibleJoin29: while (true) {
|
|
reducibleJoin28: while (true) {
|
|
if (value9 === NO_CHAT) {
|
|
break reducibleJoin28;
|
|
}
|
|
FULL_SCREEN = ChannelLayouts.FULL_SCREEN;
|
|
if (value9 !== FULL_SCREEN) {
|
|
break reducibleJoin29;
|
|
}
|
|
break reducibleJoin28;
|
|
}
|
|
staffLog(a0, 'Fullscreen video');
|
|
return false;
|
|
}
|
|
}
|
|
getMessages = MessageStore.getMessages;
|
|
channelId = a0.channelId;
|
|
value10 = Reflect.apply(getMessages, MessageStore, [channelId]);
|
|
reducibleJoin37: while (true) {
|
|
reducibleJoin36: while (true) {
|
|
if (value10 == null) {
|
|
break reducibleJoin36;
|
|
}
|
|
ready = value10.ready;
|
|
if (ready) {
|
|
loadingMore = value10.loadingMore;
|
|
if (loadingMore) {
|
|
break reducibleJoin36;
|
|
}
|
|
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
|
|
isChannelFocusedForReadStateAck = moduleValue.isChannelFocusedForReadStateAck;
|
|
channelId = a0.channelId;
|
|
isChannelFocusedForReadStateAck2 = Reflect.apply(isChannelFocusedForReadStateAck,
|
|
|
|
moduleValue,
|
|
[channelId,
|
|
a1]);
|
|
staffLogBinding = staffLog;
|
|
if (isChannelFocusedForReadStateAck2) {
|
|
staffLogBinding(a0, 'Acked');
|
|
r1 = value7;
|
|
} else {
|
|
staffLogBinding(a0, 'Chat not focused');
|
|
value = false;
|
|
r1 = value;
|
|
}
|
|
break reducibleJoin37;
|
|
}
|
|
break reducibleJoin36;
|
|
}
|
|
staffLog(a0, 'Still loading messages');
|
|
value = false;
|
|
r1 = value;
|
|
break reducibleJoin37;
|
|
}
|
|
return r1;
|
|
}
|
|
break reducibleJoin23;
|
|
}
|
|
}
|
|
isAtBottom = DimensionStore.isAtBottom;
|
|
channelId = a0.channelId;
|
|
if (Reflect.apply(isAtBottom, DimensionStore, [channelId])) {
|
|
getLayout = ChannelRTCStore.getLayout;
|
|
channelId = a0.channelId;
|
|
value9 = Reflect.apply(getLayout, ChannelRTCStore, [channelId]);
|
|
getChatOpen = ChannelRTCStore.getChatOpen;
|
|
channelId = a0.channelId;
|
|
if (!Reflect.apply(getChatOpen, ChannelRTCStore, [channelId])) {
|
|
reducibleJoin29: while (true) {
|
|
reducibleJoin28: while (true) {
|
|
if (value9 === ChannelLayouts.NO_CHAT) {
|
|
break reducibleJoin28;
|
|
}
|
|
FULL_SCREEN = ChannelLayouts.FULL_SCREEN;
|
|
if (value9 !== FULL_SCREEN) {
|
|
break reducibleJoin29;
|
|
}
|
|
break reducibleJoin28;
|
|
}
|
|
staffLog(a0, 'Fullscreen video');
|
|
return false;
|
|
}
|
|
}
|
|
getMessages = MessageStore.getMessages;
|
|
channelId = a0.channelId;
|
|
value10 = Reflect.apply(getMessages, MessageStore, [channelId]);
|
|
reducibleJoin37: while (true) {
|
|
reducibleJoin36: while (true) {
|
|
if (value10 == null) {
|
|
break reducibleJoin36;
|
|
}
|
|
ready = value10.ready;
|
|
if (ready) {
|
|
loadingMore = value10.loadingMore;
|
|
if (loadingMore) {
|
|
break reducibleJoin36;
|
|
}
|
|
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
|
|
isChannelFocusedForReadStateAck = moduleValue.isChannelFocusedForReadStateAck;
|
|
channelId = a0.channelId;
|
|
isChannelFocusedForReadStateAck2 = Reflect.apply(isChannelFocusedForReadStateAck,
|
|
moduleValue,
|
|
[channelId,
|
|
a1]);
|
|
staffLogBinding = staffLog;
|
|
if (isChannelFocusedForReadStateAck2) {
|
|
staffLogBinding(a0, 'Acked');
|
|
r1 = value7;
|
|
} else {
|
|
staffLogBinding(a0, 'Chat not focused');
|
|
value = false;
|
|
r1 = value;
|
|
}
|
|
break reducibleJoin37;
|
|
}
|
|
break reducibleJoin36;
|
|
}
|
|
staffLog(a0, 'Still loading messages');
|
|
value = false;
|
|
r1 = value;
|
|
break reducibleJoin37;
|
|
}
|
|
return r1;
|
|
}
|
|
staffLog(a0, 'Not at bottom');
|
|
return false;
|
|
}
|
|
staffLog(a0, 'No unread or mentions');
|
|
return false;
|
|
}
|
|
staffLog(a0, 'Cannot track unreads');
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function mergeChannels(a0) { // fn#39168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:23586, offset: 0x010da567, size: 24 bytes, params: 2, frame: 11
|
|
a0.forEach(_fun39169);
|
|
}
|
|
|
|
function mergeServerChannels(a0) { // fn#39170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:23871, offset: 0x010da617, size: 24 bytes, params: 2, frame: 11
|
|
a0.forEach(_fun39171);
|
|
}
|
|
|
|
function mergeForGuild(a0) { // fn#39172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:24176, offset: 0x010da6e4, size: 253 bytes, params: 2, frame: 19
|
|
var latestOnboardingQuestionId;
|
|
var value7;
|
|
const value = undefined;
|
|
((a0) => {
|
|
var env0_0 = a0;
|
|
var threads = a0.threads;
|
|
if (threads != null) {
|
|
threads.forEach(_fun39174);
|
|
}
|
|
})(a0);
|
|
mergeGuildEvents(a0);
|
|
let binding = env0_79;
|
|
let get = binding.get;
|
|
let id = a0.id;
|
|
const GUILD_HOME = ReadStateTypes.GUILD_HOME;
|
|
const value3 = Reflect.apply(get, binding, [id, GUILD_HOME]);
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const fromTimestamp = defaultImport.fromTimestamp;
|
|
const defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
const Date = global.Date;
|
|
const value5 = defaultImport2(Date.now()).subtract(24, 'h');
|
|
value3.lastMessageId = Reflect.apply(fromTimestamp, defaultImport, [value5.valueOf()]);
|
|
const guild = GuildStore.getGuild(a0.id);
|
|
if (guild != null) {
|
|
latestOnboardingQuestionId = guild == null ? value : guild.latestOnboardingQuestionId;
|
|
if (latestOnboardingQuestionId != null) {
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = guild.id;
|
|
value7 = Reflect.apply(get, binding, [id, ReadStateTypes.GUILD_ONBOARDING_QUESTION]);
|
|
id = guild.id;
|
|
value7._guildId = id;
|
|
value7.lastMessageId = latestOnboardingQuestionId;
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function mergeRelationships(a0) { // fn#39177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:25485, offset: 0x010daa55, size: 19 bytes, params: 2, frame: 11
|
|
mergeNotificationCenter(a0);
|
|
}
|
|
|
|
function getThreadAckMessageTimestamp(a0, a1) { // fn#39180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:25876, offset: 0x010dab9a, size: 395 bytes, params: 3, frame: 20
|
|
var r4;
|
|
var r1;
|
|
var r6;
|
|
var r3;
|
|
var Date;
|
|
var value8;
|
|
var date;
|
|
let value = a0;
|
|
const channel = ChannelStore.getChannel(a1);
|
|
value = GuildStore.getGuild(value ?? channel?.guild_id);
|
|
if (channel == null) {
|
|
value = getGuildJoinedAtTime(value);
|
|
r4 = value;
|
|
} else if (channel.isForumPost()) {
|
|
r4 = 0;
|
|
} else {
|
|
value = getGuildJoinedAtTime(value);
|
|
r4 = value;
|
|
}
|
|
value = JoinedThreadsStore.joinTimestamp(a1);
|
|
const value5 = undefined;
|
|
if (value == null) {
|
|
r1 = value5;
|
|
} else {
|
|
value = value.getTime();
|
|
r1 = value;
|
|
}
|
|
value = 0;
|
|
let r8 = r1 ?? value;
|
|
const value6 = r8 - 5000;
|
|
const r9 = global.isNaN(value6) ? -5000 : value6;
|
|
const archiveTimestamp = channel == null || channel.threadMetadata == null ? value5 : channel.threadMetadata.archiveTimestamp;
|
|
if (archiveTimestamp != null) {
|
|
Date = global.Date;
|
|
value8 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(archiveTimestamp);
|
|
r6 = (date instanceof Object ? date : value8).getTime() - 1;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
r8 = global.isNaN(r6) ? value : r6;
|
|
const Math = global.Math;
|
|
const value12 = Math.max(r9, r8);
|
|
r3 = global.isNaN(value12 <= value ? (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(a1) - 1 : value12) || r3 <= value ? value : r3;
|
|
return global.isNaN(r4) ? r3 : global.Math.max(r4, r3);
|
|
}
|
|
|
|
function getGuildJoinedAtTime(a0) { // fn#39181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:26376, offset: 0x010dad25, size: 217 bytes, params: 2, frame: 14
|
|
var date;
|
|
if (a0 == null) {
|
|
return global.Date.now();
|
|
}
|
|
let joinedAt = a0.joinedAt;
|
|
if (joinedAt == null) {
|
|
return global.Date.now();
|
|
}
|
|
joinedAt = a0.joinedAt;
|
|
const Date = global.Date;
|
|
let value = joinedAt instanceof Date;
|
|
if (value) {
|
|
value = a0.joinedAt.getTime();
|
|
if (global.isNaN(value)) {
|
|
return global.Date.now();
|
|
}
|
|
return value;
|
|
}
|
|
if (typeof joinedAt === 'string') {
|
|
date = new global.Date(a0.joinedAt);
|
|
date = date.getTime();
|
|
if (global.isNaN(date)) {
|
|
return global.Date.now();
|
|
}
|
|
return date;
|
|
}
|
|
if (typeof a0.joinedAt !== 'number') {
|
|
return global.Date.now();
|
|
}
|
|
if (global.isNaN(a0.joinedAt)) {
|
|
return global.Date.now();
|
|
}
|
|
return a0.joinedAt;
|
|
}
|
|
|
|
function isOldReadState(a0, a1) { // fn#39182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:26706, offset: 0x010dadfe, size: 199 bytes, params: 3, frame: 22
|
|
var r3;
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var defaultImport;
|
|
var value2;
|
|
var value4;
|
|
var defaultImport2;
|
|
var value7;
|
|
let value = a0.mentionCount > 0;
|
|
if (value) {
|
|
r0 = value;
|
|
} else {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value2 = defaultImport.compare(a0.channelId, a1) > 0;
|
|
if (value2) {
|
|
r1 = !value2;
|
|
} else {
|
|
value4 = a0._ackMessageId != null;
|
|
if (value4) {
|
|
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r3 = defaultImport2.compare(a0._ackMessageId, a1) > 0;
|
|
} else {
|
|
r3 = value4;
|
|
}
|
|
if (r3) {
|
|
r2 = !r3;
|
|
} else {
|
|
value7 = a0._lastMessageId != null;
|
|
if (value7) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(a0._lastMessageId, a1) > 0;
|
|
r3 = value;
|
|
} else {
|
|
r3 = value7;
|
|
}
|
|
value = !r3;
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function tryAck(a0, a1, a2) { // fn#39183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:26931, offset: 0x010daec5, size: 83 bytes, params: 4, frame: 14
|
|
if (a1 == null) {
|
|
return false;
|
|
}
|
|
const value2 = env0_79.get(a1);
|
|
const shouldAutomaticallyAck2 = shouldAutomaticallyAck(value2, a2);
|
|
return shouldAutomaticallyAck2 ? value2.ack({trackAnalytics: true, location: a0}) : !!shouldAutomaticallyAck2;
|
|
}
|
|
|
|
function tryAckParentForumChannel(a0) { // fn#39184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:27065, offset: 0x010daf18, size: 302 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
var parent_id;
|
|
var value4;
|
|
var hasLoaded2;
|
|
var defaultImport;
|
|
if (a0 != null) {
|
|
value2 = env0_79.get(a0);
|
|
if (value2.type === ReadStateTypes.CHANNEL) {
|
|
value3 = ChannelStore.getChannel(value2.channelId);
|
|
if (value3 != null) {
|
|
if (value3.isForumPost()) {
|
|
parent_id = value3.parent_id;
|
|
if (parent_id != null) {
|
|
parent_id = value3.parent_id;
|
|
value4 = env0_79.get(parent_id);
|
|
hasLoaded2 = ActiveThreadsStore.hasLoaded(value3.guild_id);
|
|
if (hasLoaded2) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r0 = defaultImport.keys(ActiveThreadsStore.getThreadsForParent(value3.guild_id,
|
|
parent_id)).every(_fun39185);
|
|
} else {
|
|
r0 = hasLoaded2;
|
|
}
|
|
if (r0) {
|
|
value4.ack({trackAnalytics: true, location: {section: AnalyticsSections.CHANNEL,
|
|
object: AnalyticsObjects.ACK_FORUM_CHANNEL_NO_UNREAD_POSTS,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function LOGOUT_39186() { // fn#39186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:27542, offset: 0x010db095, size: 36 bytes, params: 1, frame: 11
|
|
if (env0_72 != null) {
|
|
global.clearTimeout(env0_72);
|
|
}
|
|
}
|
|
|
|
function mergeChannelTimestampUpdates(a0) { // fn#39187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:27741, offset: 0x010db0b9, size: 125 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var value4;
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value5;
|
|
var last_message_id;
|
|
var last_pin_timestamp;
|
|
var parseTimestampBinding;
|
|
var value6;
|
|
const value2 = _createForOfIteratorHelperLoose_39151(a0);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r2 = value3;
|
|
while (true) {
|
|
value4 = r2.value;
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = value4.id;
|
|
value5 = Reflect.apply(get, binding, [id]);
|
|
last_message_id = value4.last_message_id;
|
|
if (last_message_id != null) {
|
|
last_message_id = value4.last_message_id;
|
|
value5.lastMessageId = last_message_id;
|
|
}
|
|
last_pin_timestamp = value4.last_pin_timestamp;
|
|
if (last_pin_timestamp == null) {
|
|
continue;
|
|
}
|
|
parseTimestampBinding = parseTimestamp;
|
|
last_pin_timestamp = value4.last_pin_timestamp;
|
|
value5.lastPinTimestamp = parseTimestampBinding(last_pin_timestamp);
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value6;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function MESSAGE_DELETE({channelId}) { // fn#39188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28022, offset: 0x010db136, size: 39 bytes, params: 2, frame: 11
|
|
env0_79.get(channelId).rebuildChannelState();
|
|
}
|
|
|
|
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_39190({data}) { // fn#39190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28176, offset: 0x010db176, size: 29 bytes, params: 2, frame: 11
|
|
data.forEach(function({messages, threads}) {
|
|
messages.forEach(_fun39192);
|
|
mergeServerChannels(threads);
|
|
});
|
|
}
|
|
|
|
function currentUserIsEventCreator(a0) { // fn#39194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28382, offset: 0x010db216, size: 58 bytes, params: 2, frame: 12
|
|
const currentUser = UserStore.getCurrentUser();
|
|
return a0.creator_id != null && currentUser != null && a0.creator_id === currentUser.id;
|
|
}
|
|
|
|
function CHANNEL_DELETE_39195({channel}) { // fn#39195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28501, offset: 0x010db250, size: 33 bytes, params: 2, frame: 11
|
|
const binding = env0_79;
|
|
return binding.clear(channel.id);
|
|
}
|
|
|
|
function handleChannelSectionStoreUpdate() { // fn#39196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28565, offset: 0x010db271, size: 117 bytes, params: 1, frame: 15
|
|
const currentSidebarChannelId = ChannelSectionStore.getCurrentSidebarChannelId(env0_66);
|
|
return env0_67 !== currentSidebarChannelId ? clearOldestUnreadMessageId(env0_67) : tryAck({section: AnalyticsSections.CHANNEL,
|
|
object: AnalyticsObjects.ACK_CHANNEL_SECTION_STORE_UPDATE, objectType: AnalyticsObjectTypes.ACK_AUTOMATIC},
|
|
currentSidebarChannelId) || false;
|
|
}
|
|
|
|
function clearManualAck(a0) { // fn#39197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28812, offset: 0x010db2e6, size: 38 bytes, params: 2, frame: 11
|
|
if (a0 != null) {
|
|
env0_79.get(a0).isManualAck = false;
|
|
}
|
|
}
|
|
|
|
function clearOldestUnreadMessageId(a0) { // fn#39198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28875, offset: 0x010db30c, size: 56 bytes, params: 2, frame: 12
|
|
var r0;
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
var value;
|
|
const hasUnread2 = env0_79.get(a0).hasUnread();
|
|
if (hasUnread2) {
|
|
r0 = !hasUnread2;
|
|
} else {
|
|
value.oldestUnreadMessageId = null;
|
|
value = true;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MESSAGE_ACK_39199({channelId, messageId, manual, newMentionCount}) { // fn#39199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:29006, offset: 0x010db344, size: 120 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var value3;
|
|
const value = env0_79.get(channelId);
|
|
if (manual) {
|
|
value3 = true;
|
|
value.rebuildChannelState(messageId, value3, newMentionCount);
|
|
value.clearOutgoingAck();
|
|
r0 = value3;
|
|
} else {
|
|
r0 = messageId !== value._ackMessageId && value.ack({'messageId': null, 'local': true, 'trackAnalytics': false,
|
|
messageId: messageId});
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function handleNonChannelAck(a0, a1, a2, a3) { // fn#39201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:29339, offset: 0x010db3e5, size: 196 bytes, params: 5, frame: 18
|
|
var r1;
|
|
var r7;
|
|
var ack;
|
|
let value = a2;
|
|
const value2 = a3;
|
|
const value4 = env0_79.get(a0, a1);
|
|
let r0 = value !== value4.ackMessageId && value4.lastMessageId !== value4.ackMessageId;
|
|
if (r0) {
|
|
r1 = value4.lastMessageId != null || value4.mentionCount !== 0;
|
|
if (r1) {
|
|
r7 = value ?? value4.lastMessageId;
|
|
if (r7 == null) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.fromTimestamp(value4.getAckTimestamp());
|
|
r7 = value;
|
|
}
|
|
ack = value4.ack;
|
|
value = value2 == null;
|
|
value = Reflect.apply(ack, value4, [{messageId: r7, local: value || value2, trackAnalytics: false}]);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun39203() { // fn#39203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:2525, offset: 0x010db4a9, size: 230 bytes, params: 1, frame: 15
|
|
return env0_9(AutoAckableChannelTracker, [{key: 'addWindowId', value: function(a0, a1) {
|
|
if (this.channelWindowIds[a0] == null) {
|
|
this.channelWindowIds[a0] = new global.Set();
|
|
}
|
|
this.channelWindowIds[a0].add(a1);
|
|
}}, {key: 'hasWindowId', value: function(a0, a1) {
|
|
return this.channelWindowIds[a0] != null && this.channelWindowIds[a0].has(a1);
|
|
}}, {key: 'isChannelAckable', value: function(a0) {
|
|
return this.channelWindowIds[a0] != null && this.channelWindowIds[a0].size > 0;
|
|
}}, {key: 'getAllWindowIds', value: function(a0) {
|
|
return this.channelWindowIds[a0] == null ? [] : global.Array.from(this.channelWindowIds[a0]);
|
|
}}, {key: 'getAllChannelIdsForWindowId', value: value_39209}, {key: 'isAnyWindowFocused', value: function(a0) {
|
|
var value4;
|
|
var property = this.channelWindowIds[a0];
|
|
if (property == null) {
|
|
return false;
|
|
}
|
|
var value2 = _createForOfIteratorHelperLoose_39151(property);
|
|
var value3 = value2();
|
|
if (value3.done) {
|
|
return false;
|
|
}
|
|
var r1 = value3;
|
|
loopExit2: while (true) {
|
|
property = r1.value;
|
|
if (WindowStore.isFocused(property)) {
|
|
break loopExit2;
|
|
}
|
|
value4 = value2();
|
|
if (value4.done) {
|
|
return false;
|
|
}
|
|
r1 = value4;
|
|
continue;
|
|
}
|
|
return true;
|
|
}}, {key: 'removeWindowId', value: function(a0, a1) {
|
|
if (this.channelWindowIds[a0] != null) {
|
|
this.channelWindowIds[a0].delete(a1);
|
|
if (this.channelWindowIds[a0].size === 0) {
|
|
delete this.channelWindowIds[a0];
|
|
}
|
|
}
|
|
}}, {key: 'forEachChannel', value: value_39212}]);
|
|
}
|
|
|
|
function _fun39213() { // fn#39213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:6938, offset: 0x010db88c, size: 1209 bytes, params: 1, frame: 17
|
|
return env0_9(ReadState, [{key: 'serialize', value: value_39215}, {key: 'deserializeForOverlay',
|
|
value: value_39216}, {key: 'incrementGuildUnreadsSentinel', value: value_39217}, {key: 'oldestUnreadMessageId',
|
|
get: function() {
|
|
return this._oldestUnreadMessageId;
|
|
}, set: function(a0) {
|
|
this._oldestUnreadMessageId = a0;
|
|
this.oldestUnreadMessageIdStale = false;
|
|
}}, {key: 'lastMessageId', get: function() {
|
|
return this._lastMessageId;
|
|
}, set: set_39221}, {key: 'lastMessageTimestamp', get: function() {
|
|
return this._lastMessageTimestamp;
|
|
}}, {key: 'ackMessageId', get: function() {
|
|
return this._ackMessageId;
|
|
}, set: set_39224}, {key: 'unreadCount', get: function() {
|
|
return this._unreadCount ?? 0;
|
|
}, set: function(a0) {
|
|
if (!(this._unreadCount !== undefined && this._unreadCount !== 0 && a0 !== 0)) {
|
|
this.incrementGuildUnreadsSentinel();
|
|
}
|
|
this._unreadCount = a0;
|
|
}}, {key: 'mentionCount', get: function() {
|
|
return this._mentionCount;
|
|
}, set: set_39228}, {key: 'isMentionLowImportance', get: get_39229, set: set_39230}, {key: 'guessAckMessageId',
|
|
value: value_39231}, {key: 'guildId', get: function() {
|
|
var r1;
|
|
var value = null;
|
|
if (value != this._guildId) {
|
|
return this._guildId;
|
|
}
|
|
var value3 = ChannelStore.getChannel(this.channelId);
|
|
r1 = value != value3 ? value3.getGuildId() : value;
|
|
this._guildId = r1;
|
|
return r1;
|
|
}}, {key: 'isPrivate', value: value_39234}, {key: 'rebuildChannelState', value: value_39235},
|
|
{key: 'handleGuildEventRemoval', value: value_39237}, {key: 'canTrackUnreads', value: value_39239},
|
|
{key: 'canBeUnread', value: value_39240}, {key: 'canHaveMentions', value: value_39241},
|
|
{key: 'getGuildChannelUnreadState', value: value_39242}, {key: 'hasUnread', value: function() {
|
|
return this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
}}, {key: 'hasRecentlyVisitedAndRead', value: value_39244}, {key: 'isForumPostUnread', value: function() {
|
|
var _isActiveThread = this._isActiveThread;
|
|
return _isActiveThread ? this.hasUnread() : !!_isActiveThread;
|
|
}}, {key: 'hasMentions', value: function() {
|
|
return this.getMentionCount() > 0;
|
|
}}, {key: 'getMentionCount', value: function() {
|
|
return this.mentionCount;
|
|
}}, {key: 'hasUnreadOrMentions', value: function() {
|
|
return this.hasMentions() || this.hasUnread();
|
|
}}, {key: 'ackPins', value: value_39249}, {key: 'ack', value: value_39251}, {key: 'takeSnapshot',
|
|
value: value_39253}, {key: 'clearOutgoingAck', value: function() {
|
|
this.outgoingAck = null;
|
|
if (this.outgoingAckTimer != null) {
|
|
global.clearTimeout(this.outgoingAckTimer);
|
|
this.outgoingAckTimer = null;
|
|
}
|
|
}}, {key: '_shouldAck', value: value_39255}, {key: '_ack', value: value_39256}, {key: 'recalculateFlags',
|
|
value: value_39260}, {key: '_nonChannelAck', value: value_39261}, {key: 'delete', value: value_39263},
|
|
{key: 'shouldDeleteReadState', value: value_39264}, {key: 'getAckTimestamp', value: value_39265},
|
|
{key: 'oldestUnreadTimestamp', get: get_39266}, {key: 'syncThreadSettings', value: value_39267},
|
|
{key: 'recordLastViewedTime', value: value_39268}], [{key: 'forEach', value: value_39269}, {key: 'get',
|
|
value: value_39270}, {key: 'getGuildSentinels', value: function(a0) {
|
|
if (this._guildReadStateSentinels[a0] == null) {
|
|
this._guildReadStateSentinels[a0] = {unreadsSentinel: 0};
|
|
}
|
|
return this._guildReadStateSentinels[a0];
|
|
}}, {key: 'resetGuildSentinels', value: function() {
|
|
this._guildReadStateSentinels = {};
|
|
}}, {key: 'getIfExists', value: value_39273}, {key: 'getMentionChannelIds', value: value_39274}, {key: 'getValue',
|
|
value: function(a0) {
|
|
var r0;
|
|
var value = a1;
|
|
var value2 = a3;
|
|
value = this.getIfExists(a0, value !== undefined ? value : ReadStateTypes.CHANNEL);
|
|
if (value == null) {
|
|
r0 = value2;
|
|
} else {
|
|
value = a2(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}}, {key: 'clear', value: value_39276}, {key: 'clearAll', value: function() {
|
|
ReadState._readStates.clear();
|
|
ReadState._mentionChannels.clear();
|
|
}}]);
|
|
}
|
|
|
|
function _fun39279(a0) { // fn#39279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:29654, offset: 0x010ddf43, size: 757 bytes, params: 2, frame: 16
|
|
const closure = ReadStateStoreClass;
|
|
env0_5(closure, a0);
|
|
return env0_9(closure, [{key: 'initialize', value: value_39281}, {key: 'getReadStatesByChannel',
|
|
value: value_39282}, {key: 'getForDebugging', value: value_39283}, {key: 'getNotifCenterReadState',
|
|
value: value_39284}, {key: 'hasUnread', value: value_39285}, {key: 'hasUnreadOrMentions', value: value_39287},
|
|
{key: 'hasTrackedUnread', value: value_39289}, {key: 'isForumPostUnread', value: value_39291},
|
|
{key: 'getUnreadCount', value: value_39293}, {key: 'getMentionCount', value: value_39295},
|
|
{key: 'getIsMentionLowImportance', value: value_39297}, {key: 'getGuildChannelUnreadState', value: value_39299},
|
|
{key: 'hasRecentlyVisitedAndRead', value: value_39301}, {key: 'ackMessageId', value: value_39303},
|
|
{key: 'getTrackedAckMessageId', value: value_39305}, {key: 'lastMessageId', value: value_39307},
|
|
{key: 'lastMessageTimestamp', value: value_39309}, {key: 'lastPinTimestamp', value: value_39311},
|
|
{key: 'getOldestUnreadMessageId', value: value_39313}, {key: 'getOldestUnreadTimestamp', value: value_39315},
|
|
{key: 'isEstimated', value: value_39317}, {key: 'hasOpenedThread', value: value_39319}, {key: 'hasUnreadPins',
|
|
value: value_39321}, {key: 'isNewForumThread', value: value_39323}, {key: 'getAllReadStates',
|
|
value: value_39324}, {key: 'getGuildUnreadsSentinel', value: value_39326}, {key: 'getMentionChannelIds',
|
|
value: value_39327}, {key: 'getNonChannelAckId', value: value_39328}, {key: 'getSnapshot', value: value_39329},
|
|
{key: 'getChannelIdsForWindowId', value: value_39330}]);
|
|
}
|
|
|
|
function BACKGROUND_SYNC_CHANNEL_MESSAGES({changesByChannelId}) { // fn#39331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:34242, offset: 0x010deda5, size: 309 bytes, params: 2, frame: 36
|
|
var r20;
|
|
var r3;
|
|
var r1;
|
|
var r2;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var binding;
|
|
var ifExists;
|
|
var _createForOfIteratorHelperLoose_39151Binding;
|
|
var new_messages;
|
|
var property2;
|
|
var items2;
|
|
var concat;
|
|
var modified_messages;
|
|
var value4;
|
|
var filter;
|
|
var isNotNullish;
|
|
var value5;
|
|
var value6;
|
|
var done;
|
|
var value7;
|
|
var defaultImport;
|
|
var compare;
|
|
var id;
|
|
var lastMessageId;
|
|
var value8;
|
|
for (propertyName in changesByChannelId) {
|
|
property = changesByChannelId[propertyName];
|
|
binding = env0_79;
|
|
ifExists = binding.getIfExists(propertyName);
|
|
if (ifExists == null) {
|
|
r20 = propertyName2;
|
|
continue;
|
|
}
|
|
_createForOfIteratorHelperLoose_39151Binding = _createForOfIteratorHelperLoose_39151;
|
|
new_messages = property.new_messages;
|
|
if (new_messages == null) {
|
|
r3 = undefined;
|
|
continue;
|
|
}
|
|
property2 = new_messages[0];
|
|
r3 = property2;
|
|
items2 = [r3];
|
|
concat = items2.concat;
|
|
modified_messages = property.modified_messages;
|
|
if (modified_messages != null) {
|
|
r1 = modified_messages;
|
|
continue;
|
|
}
|
|
value4 = Reflect.apply(concat, items2, [[]]);
|
|
filter = value4.filter;
|
|
isNotNullish = (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish;
|
|
value5 = _createForOfIteratorHelperLoose_39151Binding(Reflect.apply(filter, value4, [isNotNullish]));
|
|
value6 = value5();
|
|
done = value6.done;
|
|
if (done) {
|
|
r20 = propertyName2;
|
|
continue;
|
|
}
|
|
r2 = value6;
|
|
while (true) {
|
|
value7 = r2.value;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
compare = defaultImport.compare;
|
|
id = value7.id;
|
|
lastMessageId = ifExists.lastMessageId;
|
|
if (Reflect.apply(compare, defaultImport, [id, lastMessageId]) === 1) {
|
|
id = value7.id;
|
|
ifExists.lastMessageId = id;
|
|
}
|
|
value8 = value5();
|
|
done = value8.done;
|
|
if (done) {
|
|
r20 = propertyName2;
|
|
break;
|
|
}
|
|
r2 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function CONNECTION_OPEN_39332({guilds, relationships, initialPrivateChannels, readState}) { // fn#39332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:34632, offset: 0x010deeda, size: 456 bytes, params: 2, frame: 21
|
|
var r4;
|
|
var r3;
|
|
var value4;
|
|
var defaultImport;
|
|
var fromTimestamp;
|
|
var Date;
|
|
var value7;
|
|
var channels;
|
|
var op;
|
|
var writes;
|
|
var items2;
|
|
var channelTimestampUpdates;
|
|
var mergeChannelTimestampUpdatesBinding;
|
|
var value8;
|
|
DECAY_READ_STATES();
|
|
let binding = env0_69;
|
|
if (!(binding || readState.partial)) {
|
|
env0_79.clearAll();
|
|
}
|
|
readState.entries.forEach(_fun39333);
|
|
env0_79.resetGuildSentinels();
|
|
const id = UserStore.getCurrentUser()?.id;
|
|
if (id != null) {
|
|
binding = env0_79;
|
|
value4 = binding.get(id, ReadStateTypes.NOTIFICATION_CENTER);
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
fromTimestamp = defaultImport.fromTimestamp;
|
|
Date = global.Date;
|
|
value4.lastMessageId = Reflect.apply(fromTimestamp, defaultImport, [Date.now()]);
|
|
}
|
|
mergeRelationships(relationships);
|
|
mergeChannels(initialPrivateChannels);
|
|
const value5 = _createForOfIteratorHelperLoose_39151(guilds);
|
|
const value6 = value5();
|
|
let done = value6.done;
|
|
if (!done) {
|
|
r4 = value6;
|
|
while (true) {
|
|
value7 = r4.value;
|
|
mergeChannelsBinding = mergeChannels;
|
|
channels = value7.channels;
|
|
op = channels.op;
|
|
if (op === 'full_sync') {
|
|
channels = value7.channels;
|
|
items2 = channels.items;
|
|
r3 = items2;
|
|
} else {
|
|
channels = value7.channels;
|
|
writes = channels.writes;
|
|
r3 = writes;
|
|
}
|
|
mergeChannelsBinding(r3);
|
|
channelTimestampUpdates = value7.channelTimestampUpdates;
|
|
if (channelTimestampUpdates == null) {
|
|
continue;
|
|
}
|
|
mergeChannelTimestampUpdatesBinding = mergeChannelTimestampUpdates;
|
|
channelTimestampUpdates = value7.channelTimestampUpdates;
|
|
mergeChannelTimestampUpdatesBinding(channelTimestampUpdates);
|
|
mergeForGuild(value7);
|
|
value8 = value5();
|
|
done = value8.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
LOGOUT_39186();
|
|
const setTimeout = global.setTimeout;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
env0_72 = setTimeout(_fun39334, 10 * SECOND);
|
|
}
|
|
|
|
function OVERLAY_INITIALIZE_39336({readStates, selectedChannelId}) { // fn#39336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:36668, offset: 0x010df331, size: 94 bytes, params: 2, frame: 14
|
|
DECAY_READ_STATES();
|
|
env0_67 = ChannelSectionStore.getCurrentSidebarChannelId(selectedChannelId);
|
|
env0_79.clearAll();
|
|
readStates.forEach(_fun39337);
|
|
}
|
|
|
|
function CACHE_LOADED_39338({readStates}) { // fn#39338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:36957, offset: 0x010df3d6, size: 47 bytes, params: 2, frame: 12
|
|
DECAY_READ_STATES();
|
|
readStates.forEach(_fun39339);
|
|
}
|
|
|
|
function GUILD_CREATE_39340({guild}) { // fn#39340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:37260, offset: 0x010df4c7, size: 144 bytes, params: 2, frame: 14
|
|
const env0_1 = generateOldThreadCutoff();
|
|
env0_79.forEach(_fun39341);
|
|
mergeChannels(guild.channels.op === 'full_sync' ? guild.channels.items : guild.channels.writes);
|
|
if (guild.channelTimestampUpdates != null) {
|
|
mergeChannelTimestampUpdates(guild.channelTimestampUpdates);
|
|
}
|
|
mergeForGuild(guild);
|
|
}
|
|
|
|
function LOAD_MESSAGES_SUCCESS_39342({channelId, isAfter, messages}) { // fn#39342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:37615, offset: 0x010df594, size: 374 bytes, params: 2, frame: 21
|
|
var r1;
|
|
var defaultImport;
|
|
const value2 = env0_79.get(channelId);
|
|
value2.loadedMessages = true;
|
|
if (value2.lastMessageId == null && messages.length > 0) {
|
|
value2.lastMessageId = messages[0].id;
|
|
}
|
|
const messages2 = MessageStore.getMessages(channelId);
|
|
if (messages2 != null) {
|
|
if (messages.length > 0) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport.compare(messages[0].id, value2.ackMessageId) !== 1) {
|
|
if (messages2.hasPresent()) {
|
|
value2.rebuildChannelState();
|
|
} else if (messages2.jumpTargetId === value2.ackMessageId) {
|
|
value2.rebuildChannelState();
|
|
} else {
|
|
r1 = isAfter && value2.ackMessageId != null;
|
|
r1 = r1 && messages2.has(value2.ackMessageId, true);
|
|
if (r1) {
|
|
value2.unreadCount = value2.unreadCount + messages.length;
|
|
if (value2.oldestUnreadMessageId == null) {
|
|
value2.rebuildChannelState();
|
|
}
|
|
}
|
|
}
|
|
} else if (value2.unreadCount === 0) {
|
|
value2.rebuildChannelState();
|
|
} else if (messages2.hasPresent()) {
|
|
value2.rebuildChannelState();
|
|
} else if (messages2.jumpTargetId === value2.ackMessageId) {
|
|
value2.rebuildChannelState();
|
|
} else {
|
|
r1 = isAfter && value2.ackMessageId != null;
|
|
r1 = r1 && messages2.has(value2.ackMessageId, true);
|
|
if (r1) {
|
|
value2.unreadCount = value2.unreadCount + messages.length;
|
|
if (value2.oldestUnreadMessageId == null) {
|
|
value2.rebuildChannelState();
|
|
}
|
|
}
|
|
}
|
|
} else if (messages2.hasPresent()) {
|
|
value2.rebuildChannelState();
|
|
} else if (messages2.jumpTargetId === value2.ackMessageId) {
|
|
value2.rebuildChannelState();
|
|
} else {
|
|
r1 = isAfter && value2.ackMessageId != null;
|
|
r1 = r1 && messages2.has(value2.ackMessageId, true);
|
|
if (r1) {
|
|
value2.unreadCount = value2.unreadCount + messages.length;
|
|
if (value2.oldestUnreadMessageId == null) {
|
|
value2.rebuildChannelState();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const mergeServerChannelsBinding = mergeServerChannels;
|
|
const value9 = messages.map(function(a0) {
|
|
return a0.thread;
|
|
});
|
|
mergeServerChannelsBinding(value9.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish));
|
|
}
|
|
|
|
function LOCAL_MESSAGES_LOADED_39344({channelId, messages}) { // fn#39344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:38187, offset: 0x010df70a, size: 172 bytes, params: 2, frame: 17
|
|
var r3;
|
|
var value2;
|
|
var id;
|
|
var value3;
|
|
var value;
|
|
const iosPushNotificationRawPayloadFixExperimentModule = require(4819) /* metro dependency 4819: IOSPushNotificationRawPayloadFixExperiment */;
|
|
if (iosPushNotificationRawPayloadFixExperimentModule.isIOSPushNotificationRawPayloadFixExperimentEnabled()) {
|
|
if (messages.length === 0) {
|
|
return false;
|
|
}
|
|
value2 = env0_79.get(channelId);
|
|
id = messages[0].id;
|
|
value3 = value2.lastMessageId == null;
|
|
if (value3) {
|
|
r3 = value3;
|
|
} else {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(id, value2.lastMessageId) > 0;
|
|
r3 = value;
|
|
}
|
|
if (r3) {
|
|
value2.lastMessageId = id;
|
|
value2.rebuildChannelState();
|
|
}
|
|
return undefined;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function MESSAGE_CREATE_39345({channelId, message, isPushNotification}) { // fn#39345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:38500, offset: 0x010df7b6, size: 1371 bytes, params: 2, frame: 29
|
|
var r8;
|
|
var r12;
|
|
var name;
|
|
var r13;
|
|
var r14;
|
|
var r9;
|
|
var type;
|
|
var object2;
|
|
var id;
|
|
var value4;
|
|
var id2;
|
|
var SELF_MENTIONABLE_SYSTEM;
|
|
var has;
|
|
var outgoingAck;
|
|
var clearOutgoingAck;
|
|
var object3;
|
|
var isReady;
|
|
var isReady2;
|
|
var getChannelId;
|
|
var value9;
|
|
var getCurrentSidebarChannelId;
|
|
var value10;
|
|
var currentRoute;
|
|
var getChatOpen;
|
|
var params;
|
|
var value13;
|
|
var oldestUnreadMessageIdStale;
|
|
var moduleValue2;
|
|
var getFocusedChannelId;
|
|
var value14;
|
|
var unreadCount;
|
|
var RECIPIENT_REMOVE;
|
|
var GROUP_DM;
|
|
var moduleValue3;
|
|
var isRawMessageMentioned;
|
|
var isSuppressEveryoneEnabled;
|
|
var guildId;
|
|
var isSuppressRolesEnabled;
|
|
var getChannel;
|
|
var channel_id;
|
|
var value15;
|
|
var mentionOnAllMessages;
|
|
var isThread;
|
|
var isVocal;
|
|
var isChannelMuted;
|
|
var guild_id;
|
|
var resolvedMessageNotifications;
|
|
var value16;
|
|
var ALL_MESSAGES;
|
|
var moduleValue4;
|
|
var computeThreadNotificationSetting;
|
|
var threadNotificationSetting;
|
|
var shouldMention;
|
|
var isMentionLowImportance;
|
|
var mentionCount;
|
|
var NOTIFICATION_CENTER;
|
|
var value17;
|
|
var tabFocused;
|
|
var handleNonChannelAckBinding;
|
|
let binding = env0_79;
|
|
let get = binding.get;
|
|
const value2 = Reflect.apply(get, binding, [channelId]);
|
|
const hasUnread2 = value2.hasUnread();
|
|
let lastMessageId = value2.lastMessageId;
|
|
const value3 = lastMessageId != null;
|
|
reducibleJoin2: while (true) {
|
|
if (value3) {
|
|
lastMessageId = value2.lastMessageId;
|
|
id = message.id;
|
|
value4 = lastMessageId >= id;
|
|
r8 = value4;
|
|
break reducibleJoin2;
|
|
}
|
|
r8 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
value2.lastMessageId = message.id;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const basicChannel = ChannelStore.getBasicChannel(channelId);
|
|
let author = message.author;
|
|
if (author != null) {
|
|
reducibleJoin9: while (true) {
|
|
if (currentUser == null) {
|
|
break reducibleJoin9;
|
|
}
|
|
author = message.author;
|
|
id = author.id;
|
|
id2 = currentUser.id;
|
|
if (id !== id2) {
|
|
break reducibleJoin9;
|
|
}
|
|
SELF_MENTIONABLE_SYSTEM = MessageTypesSets.SELF_MENTIONABLE_SYSTEM;
|
|
has = SELF_MENTIONABLE_SYSTEM.has;
|
|
type = message.type;
|
|
if (!Reflect.apply(has, SELF_MENTIONABLE_SYSTEM, [type])) {
|
|
outgoingAck = value2.outgoingAck;
|
|
reducibleJoin8: while (true) {
|
|
if (outgoingAck == null) {
|
|
break reducibleJoin8;
|
|
}
|
|
clearOutgoingAck = value2.clearOutgoingAck;
|
|
Reflect.apply(clearOutgoingAck, value2, []);
|
|
break reducibleJoin8;
|
|
}
|
|
id = message.id;
|
|
return MESSAGE_ACK_39199({channelId: channelId, messageId: id, manual: false});
|
|
}
|
|
break reducibleJoin9;
|
|
}
|
|
}
|
|
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
|
|
reducibleJoin11: while (true) {
|
|
if (rootNavigationRef == null) {
|
|
r12 = undefined;
|
|
break reducibleJoin11;
|
|
}
|
|
isReady = rootNavigationRef.isReady;
|
|
isReady2 = Reflect.apply(isReady, rootNavigationRef, []);
|
|
r12 = isReady2;
|
|
break reducibleJoin11;
|
|
}
|
|
if (r12 === true) {
|
|
currentRoute = rootNavigationRef.getCurrentRoute();
|
|
getChatOpen = ChannelRTCStore.getChatOpen;
|
|
channelId = value2.channelId;
|
|
if (Reflect.apply(getChatOpen, ChannelRTCStore, [channelId])) {
|
|
channelId = value2.channelId;
|
|
r12 = channelId;
|
|
r13 = undefined;
|
|
} else {
|
|
reducibleJoin17: while (true) {
|
|
if (currentRoute == null) {
|
|
name = undefined;
|
|
break reducibleJoin17;
|
|
}
|
|
name = currentRoute.name;
|
|
break reducibleJoin17;
|
|
}
|
|
if (name === 'channel') {
|
|
channelId = currentRoute.params.channelId;
|
|
r12 = channelId;
|
|
r13 = undefined;
|
|
} else {
|
|
reducibleJoin20: while (true) {
|
|
if (currentRoute == null) {
|
|
name = undefined;
|
|
break reducibleJoin20;
|
|
}
|
|
name = currentRoute.name;
|
|
break reducibleJoin20;
|
|
}
|
|
reducibleJoin26: while (true) {
|
|
if (name !== 'guilds') {
|
|
r12 = undefined;
|
|
r13 = undefined;
|
|
break reducibleJoin26;
|
|
}
|
|
params = currentRoute.params;
|
|
reducibleJoin23: while (true) {
|
|
if (params == null) {
|
|
channelId = undefined;
|
|
break reducibleJoin23;
|
|
}
|
|
channelId = params.channelId;
|
|
break reducibleJoin23;
|
|
}
|
|
r12 = channelId;
|
|
r13 = undefined;
|
|
break reducibleJoin26;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
reducibleJoin26: while (true) {
|
|
if (rootNavigationRef == null) {
|
|
getChannelId = SelectedChannelStore.getChannelId;
|
|
value9 = Reflect.apply(getChannelId, SelectedChannelStore, []);
|
|
getCurrentSidebarChannelId = ChannelSectionStore.getCurrentSidebarChannelId;
|
|
value10 = Reflect.apply(getCurrentSidebarChannelId, ChannelSectionStore, [value9]);
|
|
r12 = value9;
|
|
r13 = value10;
|
|
break reducibleJoin26;
|
|
}
|
|
r12 = undefined;
|
|
r13 = undefined;
|
|
break reducibleJoin26;
|
|
}
|
|
}
|
|
const value12 = r12 === channelId;
|
|
reducibleJoin28: while (true) {
|
|
if (value12) {
|
|
r12 = value12;
|
|
break reducibleJoin28;
|
|
}
|
|
value13 = r13 === channelId;
|
|
r12 = value13;
|
|
break reducibleJoin28;
|
|
}
|
|
if (r12) {
|
|
reducibleJoin35: while (true) {
|
|
if (shouldAutomaticallyAck(value2)) {
|
|
if (!isPushNotification) {
|
|
if (isOverlayAckable(undefined, value2.channelId)) {
|
|
r14 = AnalyticsSections.OVERLAY;
|
|
} else {
|
|
r14 = AnalyticsSections.CHANNEL;
|
|
}
|
|
return value2.ack({messageId: message.id, trackAnalytics: true, location: {section: r14,
|
|
object: AnalyticsObjects.ACK_INCOMING_MESSAGE,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}});
|
|
}
|
|
break reducibleJoin35;
|
|
}
|
|
break reducibleJoin35;
|
|
}
|
|
}
|
|
if (isOverlayAckable(undefined, channelId)) {
|
|
return value2.ack({messageId: message.id, trackAnalytics: true, location: {section: AnalyticsSections.OVERLAY,
|
|
object: AnalyticsObjects.ACK_INCOMING_MESSAGE, objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}});
|
|
}
|
|
reducibleJoin43: while (true) {
|
|
reducibleJoin42: while (true) {
|
|
if (value2.oldestUnreadMessageId == null) {
|
|
break reducibleJoin42;
|
|
}
|
|
oldestUnreadMessageIdStale = value2.oldestUnreadMessageIdStale;
|
|
if (oldestUnreadMessageIdStale) {
|
|
break reducibleJoin42;
|
|
}
|
|
reducibleJoin40: while (true) {
|
|
if (hasUnread2) {
|
|
r9 = hasUnread2;
|
|
break reducibleJoin40;
|
|
}
|
|
moduleValue2 = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
|
|
getFocusedChannelId = moduleValue2.getFocusedChannelId;
|
|
value14 = Reflect.apply(getFocusedChannelId, moduleValue2, []) === channelId;
|
|
r9 = value14;
|
|
break reducibleJoin40;
|
|
}
|
|
if (r9) {
|
|
break reducibleJoin43;
|
|
}
|
|
id = message.id;
|
|
value2.oldestUnreadMessageId = id;
|
|
break reducibleJoin43;
|
|
}
|
|
id = message.id;
|
|
value2.oldestUnreadMessageId = id;
|
|
break reducibleJoin43;
|
|
}
|
|
reducibleJoin45: while (true) {
|
|
if (r8) {
|
|
break reducibleJoin45;
|
|
}
|
|
unreadCount = value2.unreadCount;
|
|
value2.unreadCount = typeof unreadCount === 'bigint' ? unreadCount + 1n : +unreadCount + 1;
|
|
break reducibleJoin45;
|
|
}
|
|
reducibleJoin69: while (true) {
|
|
if (RelationshipStore.isBlockedOrIgnoredForMessage(message)) {
|
|
break reducibleJoin69;
|
|
}
|
|
type = message.type;
|
|
RECIPIENT_REMOVE = MessageTypes.RECIPIENT_REMOVE;
|
|
if (type === RECIPIENT_REMOVE) {
|
|
reducibleJoin49: while (true) {
|
|
if (basicChannel == null) {
|
|
type = undefined;
|
|
break reducibleJoin49;
|
|
}
|
|
type = basicChannel.type;
|
|
break reducibleJoin49;
|
|
}
|
|
GROUP_DM = ChannelTypes.GROUP_DM;
|
|
if (type === GROUP_DM) {
|
|
break reducibleJoin69;
|
|
}
|
|
}
|
|
reducibleJoin65: while (true) {
|
|
reducibleJoin52: while (true) {
|
|
if (currentUser == null) {
|
|
break reducibleJoin52;
|
|
}
|
|
moduleValue3 = require(4639) /* metro dependency 4639: isMessageMentioned */;
|
|
isRawMessageMentioned = moduleValue3.isRawMessageMentioned;
|
|
object3 = {rawMessage: message};
|
|
id = currentUser.id;
|
|
object3.userId = id;
|
|
isSuppressEveryoneEnabled = UserGuildSettingsStore.isSuppressEveryoneEnabled;
|
|
guildId = value2.guildId;
|
|
object3.suppressEveryone = Reflect.apply(isSuppressEveryoneEnabled, UserGuildSettingsStore, [guildId]);
|
|
isSuppressRolesEnabled = UserGuildSettingsStore.isSuppressRolesEnabled;
|
|
guildId = value2.guildId;
|
|
object3.suppressRoles = Reflect.apply(isSuppressRolesEnabled, UserGuildSettingsStore, [guildId]);
|
|
if (Reflect.apply(isRawMessageMentioned, moduleValue3, [object3])) {
|
|
object2 = {'shouldMention': true, 'isMentionLowImportance': false};
|
|
break reducibleJoin65;
|
|
}
|
|
break reducibleJoin52;
|
|
}
|
|
getChannel = ChannelStore.getChannel;
|
|
channel_id = message.channel_id;
|
|
value15 = Reflect.apply(getChannel, ChannelStore, [channel_id]);
|
|
if (isNonMutedPrivateMessage(value15)) {
|
|
object2 = {'shouldMention': true, 'isMentionLowImportance': false};
|
|
break reducibleJoin65;
|
|
}
|
|
mentionOnAllMessages = UserGuildSettingsStore.mentionOnAllMessages;
|
|
if (mentionOnAllMessages) {
|
|
if (value15 != null) {
|
|
isThread = value15.isThread;
|
|
if (Reflect.apply(isThread, value15, [])) {
|
|
moduleValue4 = require(10914) /* metro dependency 10914: ThreadNotificationSettings */;
|
|
computeThreadNotificationSetting = moduleValue4.computeThreadNotificationSetting;
|
|
threadNotificationSetting = Reflect.apply(computeThreadNotificationSetting, moduleValue4,
|
|
[value15]);
|
|
ALL_MESSAGES = ThreadMemberFlags.ALL_MESSAGES;
|
|
if (threadNotificationSetting === ALL_MESSAGES) {
|
|
object2 = {'shouldMention': true, 'isMentionLowImportance': true};
|
|
break reducibleJoin65;
|
|
}
|
|
} else {
|
|
isVocal = value15.isVocal;
|
|
if (!Reflect.apply(isVocal, value15, [])) {
|
|
isChannelMuted = UserGuildSettingsStore.isChannelMuted;
|
|
guild_id = value15.guild_id;
|
|
id = value15.id;
|
|
if (!Reflect.apply(isChannelMuted, UserGuildSettingsStore, [guild_id, id])) {
|
|
resolvedMessageNotifications = UserGuildSettingsStore.resolvedMessageNotifications;
|
|
value16 = Reflect.apply(resolvedMessageNotifications, UserGuildSettingsStore,
|
|
[value15]);
|
|
ALL_MESSAGES = UserNotificationSettings.ALL_MESSAGES;
|
|
if (value16 === ALL_MESSAGES) {
|
|
object2 = {'shouldMention': true, 'isMentionLowImportance': true};
|
|
break reducibleJoin65;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
object2 = {'shouldMention': false, 'isMentionLowImportance': false};
|
|
break reducibleJoin65;
|
|
}
|
|
shouldMention = object2.shouldMention;
|
|
isMentionLowImportance = object2.isMentionLowImportance;
|
|
if (shouldMention) {
|
|
value2.isMentionLowImportance = isMentionLowImportance;
|
|
mentionCount = value2.mentionCount;
|
|
value2.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
if (currentUser == null) {
|
|
break reducibleJoin69;
|
|
}
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = currentUser.id;
|
|
NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
value17 = Reflect.apply(get, binding, [id, NOTIFICATION_CENTER]);
|
|
id = message.id;
|
|
value17.lastMessageId = id;
|
|
tabFocused = NotificationCenterItemsStore.tabFocused;
|
|
if (tabFocused) {
|
|
handleNonChannelAckBinding = handleNonChannelAck;
|
|
id = currentUser.id;
|
|
NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
handleNonChannelAckBinding(id, NOTIFICATION_CENTER, undefined, false);
|
|
break reducibleJoin69;
|
|
}
|
|
break reducibleJoin69;
|
|
}
|
|
break reducibleJoin69;
|
|
}
|
|
}
|
|
|
|
function CHANNEL_ACK_39346({channelId, messageId, immediate, force, context, location}) { // fn#39346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:41118, offset: 0x010dfd11, size: 142 bytes, params: 2, frame: 18
|
|
var r0;
|
|
immediate = !(immediate === undefined) && immediate;
|
|
force = !(force === undefined) && force;
|
|
const value2 = env0_79.get(channelId);
|
|
const ack = value2.ack;
|
|
const object2 = {messageId: messageId};
|
|
object2.local = context !== CURRENT_APP_CONTEXT;
|
|
object2.immediate = immediate;
|
|
object2.force = force;
|
|
const value = true;
|
|
object2.isExplicitUserAction = value;
|
|
object2.location = location;
|
|
object2.trackAnalytics = value;
|
|
if (messageId == null) {
|
|
r0 = Reflect.apply(ack, value2, [object2]);
|
|
} else {
|
|
value2.rebuildChannelState();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function CHANNEL_LOCAL_ACK({channelId}) { // fn#39347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:41407, offset: 0x010dfd9f, size: 72 bytes, params: 2, frame: 13
|
|
return env0_79.get(channelId).ack({'messageId': null, 'local': true, 'immediate': null, 'force': null,
|
|
'isExplicitUserAction': true, 'trackAnalytics': false, messageId: undefined, immediate: undefined,
|
|
force: undefined});
|
|
}
|
|
|
|
function CHANNEL_PINS_ACK({channelId, timestamp}) { // fn#39348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:41593, offset: 0x010dfde7, size: 44 bytes, params: 2, frame: 12
|
|
return env0_79.get(channelId).ackPins(timestamp);
|
|
}
|
|
|
|
function CHANNEL_PINS_UPDATE({channelId, lastPinTimestamp}) { // fn#39349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:41699, offset: 0x010dfe13, size: 65 bytes, params: 2, frame: 13
|
|
var r0;
|
|
const value2 = env0_79.get(channelId);
|
|
let value = parseTimestamp(lastPinTimestamp);
|
|
const value3 = value2.lastPinTimestamp !== value;
|
|
if (value3) {
|
|
value2.lastPinTimestamp = value;
|
|
value = true;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function CHANNEL_SELECT_39350({channelId}) { // fn#39350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:41875, offset: 0x010dfe54, size: 427 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var binding;
|
|
var value4;
|
|
var ackMessageId;
|
|
var defaultImport;
|
|
const currentSidebarChannelId = ChannelSectionStore.getCurrentSidebarChannelId(channelId);
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
if (channel != null) {
|
|
binding = env0_79;
|
|
value4 = binding.get(channel.id);
|
|
ackMessageId = value4.ackMessageId;
|
|
if (ackMessageId != null) {
|
|
r0 = ackMessageId;
|
|
} else {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r0 = defaultImport.fromTimestamp(value4.getAckTimestamp());
|
|
}
|
|
value4.ackMessageIdAtChannelSelect = r0;
|
|
value4.recordLastViewedTime();
|
|
}
|
|
const clearManualAckBinding = clearManualAck;
|
|
clearManualAckBinding(env0_66);
|
|
clearManualAckBinding(env0_67);
|
|
const r4 = !(env0_66 === channelId) && (clearOldestUnreadMessageId(env0_67) || (clearOldestUnreadMessageId(env0_66) || false));
|
|
const r5 = env0_66 === channelId || channel?.type != null && ChannelTypesSets.GUILD_THREADS_ONLY.has(channel.type) ? tryAck({section: AnalyticsSections.CHANNEL,
|
|
object: AnalyticsObjects.ACK_CHANNEL_SELECT_SAME_CHANNEL, objectType: AnalyticsObjectTypes.ACK_AUTOMATIC},
|
|
channelId) || r4 : r4;
|
|
return env0_66 !== channelId ? r5 : tryAck({section: AnalyticsSections.CHANNEL,
|
|
object: AnalyticsObjects.ACK_CHANNEL_SELECT_SAME_CHANNEL_SIDEBAR,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}, currentSidebarChannelId) || r5;
|
|
}
|
|
|
|
function OVERLAY_TEXT_CHAT_ACK_CHANNEL({channelId}) { // fn#39351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:42615, offset: 0x010dffff, size: 168 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var defaultImport;
|
|
const ACK_CHANNEL_SELECT_SAME_CHANNEL_DISPATCH = AnalyticsObjects.ACK_CHANNEL_SELECT_SAME_CHANNEL_DISPATCH;
|
|
const value2 = env0_79.get(channelId);
|
|
const ackMessageId = value2.ackMessageId;
|
|
if (ackMessageId != null) {
|
|
r0 = ackMessageId;
|
|
} else {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r0 = defaultImport.fromTimestamp(value2.getAckTimestamp());
|
|
}
|
|
value2.ackMessageIdAtChannelSelect = r0;
|
|
value2.recordLastViewedTime();
|
|
clearOldestUnreadMessageId(channelId);
|
|
const tryAckBinding = tryAck;
|
|
const OVERLAY = AnalyticsSections.OVERLAY;
|
|
const ACK_AUTOMATIC = AnalyticsObjectTypes.ACK_AUTOMATIC;
|
|
tryAckBinding({section: OVERLAY, object: ACK_CHANNEL_SELECT_SAME_CHANNEL_DISPATCH, objectType: ACK_AUTOMATIC},
|
|
channelId);
|
|
return true;
|
|
}
|
|
|
|
function VOICE_CHANNEL_SELECT_39352({channelId}) { // fn#39352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:43034, offset: 0x010e00a7, size: 132 bytes, params: 2, frame: 14
|
|
if (channelId == null) {
|
|
return undefined;
|
|
}
|
|
const value2 = env0_79.get(channelId);
|
|
if (value2.hasMentions()) {
|
|
return undefined;
|
|
}
|
|
value2.oldestUnreadMessageId = null;
|
|
const ack = value2.ack;
|
|
const CHANNEL = AnalyticsSections.CHANNEL;
|
|
const ACK_VOICE_CHANNEL_SELECT = AnalyticsObjects.ACK_VOICE_CHANNEL_SELECT;
|
|
const ACK_SEMI_AUTOMATIC = AnalyticsObjectTypes.ACK_SEMI_AUTOMATIC;
|
|
return Reflect.apply(ack, value2, [{'isExplicitUserAction': true, 'trackAnalytics': true,
|
|
location: {section: CHANNEL, object: ACK_VOICE_CHANNEL_SELECT, objectType: ACK_SEMI_AUTOMATIC}}]);
|
|
}
|
|
|
|
function CHANNEL_CREATE_39353({channel}) { // fn#39353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:43330, offset: 0x010e012b, size: 88 bytes, params: 2, frame: 14
|
|
var binding;
|
|
var value2;
|
|
if (isReadableType(channel.type)) {
|
|
binding = env0_79;
|
|
value2 = binding.get(channel.id);
|
|
value2.lastMessageId = channel.lastMessageId;
|
|
value2.lastPinTimestamp = parseTimestamp(channel.lastPinTimestamp);
|
|
return undefined;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function THREAD_CREATE_39354({channel}) { // fn#39354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:43515, offset: 0x010e0183, size: 261 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var get;
|
|
var value2;
|
|
if (ALL_CHANNEL_TYPES.has(channel.type)) {
|
|
binding = env0_79;
|
|
value2 = binding.get(channel.id);
|
|
value2.lastMessageId = channel.lastMessageId;
|
|
value2.lastPinTimestamp = parseTimestamp(channel.lastPinTimestamp);
|
|
value2.syncThreadSettings();
|
|
if (channel.ownerId === AuthenticationStore.getId()) {
|
|
value2.loadedMessages = true;
|
|
}
|
|
}
|
|
const parent_id = channel.parent_id;
|
|
env0_79.get(parent_id).lastMessageId = channel.id;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const ownerId = channel.ownerId;
|
|
let id = currentUser?.id;
|
|
if (ownerId === id) {
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = channel.id;
|
|
Reflect.apply(get, binding, [id])._persisted = true;
|
|
id = channel.id;
|
|
MESSAGE_ACK_39199({channelId: parent_id, messageId: id, manual: false});
|
|
}
|
|
}
|
|
|
|
function THREAD_UPDATE({channel}) { // fn#39355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:44056, offset: 0x010e0288, size: 70 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var binding;
|
|
var value;
|
|
const value2 = ALL_CHANNEL_TYPES.has(channel.type);
|
|
if (value2) {
|
|
binding = env0_79;
|
|
value = binding.get(channel.id);
|
|
value = value.syncThreadSettings();
|
|
r0 = value;
|
|
} else {
|
|
r0 = !!value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function THREAD_LIST_SYNC_39356({threads}) { // fn#39356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:44172, offset: 0x010e02ce, size: 30 bytes, params: 2, frame: 11
|
|
threads.forEach(_fun39357);
|
|
}
|
|
|
|
function THREAD_MEMBER_UPDATE_39358({id}) { // fn#39358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:44793, offset: 0x010e03ca, size: 37 bytes, params: 2, frame: 11
|
|
return env0_79.get(id).syncThreadSettings();
|
|
}
|
|
|
|
function THREAD_MEMBERS_UPDATE_39359(a0) { // fn#39359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:44896, offset: 0x010e03ef, size: 73 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var binding;
|
|
var value;
|
|
const value2 = (require(3791) /* metro dependency 3791: ThreadActionUtils */).doesThreadMembersActionAffectMe(a0);
|
|
if (value2) {
|
|
binding = env0_79;
|
|
value = binding.get(a0.id);
|
|
value = value.syncThreadSettings();
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function WINDOW_FOCUS(a0) { // fn#39360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:45104, offset: 0x010e0438, size: 44 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
const env0_1 = false;
|
|
env0_73.forEachChannel(_fun39361);
|
|
return env0_1;
|
|
}
|
|
|
|
function BULK_ACK({channels, context, onFinished}) { // fn#39364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:45689, offset: 0x010e056b, size: 53 bytes, params: 2, frame: 16
|
|
_handleBulkAck(channels.filter(_fun39368), context, onFinished);
|
|
}
|
|
|
|
function GUILD_SCHEDULED_EVENT_CREATE_39371({guildScheduledEvent}) { // fn#39371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:46441, offset: 0x010e06c9, size: 164 bytes, params: 2, frame: 16
|
|
var mentionCount;
|
|
const guild_id = guildScheduledEvent.guild_id;
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const guild_id2 = guildScheduledEvent.guild_id;
|
|
const GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
const value2 = Reflect.apply(get, binding, [guild_id2, GUILD_EVENT]);
|
|
value2.lastMessageId = guildScheduledEvent.id;
|
|
if (currentUserIsEventCreator(guildScheduledEvent)) {
|
|
GUILD_FEATURE_ACK_39200({type: 'GUILD_FEATURE_ACK', id: guild_id, ackType: ReadStateTypes.GUILD_EVENT,
|
|
ackedId: guildScheduledEvent.id, local: false});
|
|
} else if (!UserGuildSettingsStore.isMuteScheduledEventsEnabled(guild_id)) {
|
|
mentionCount = value2.mentionCount;
|
|
value2.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
}
|
|
}
|
|
|
|
function GUILD_SCHEDULED_EVENT_UPDATE({guildScheduledEvent}) { // fn#39372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:46792, offset: 0x010e076d, size: 135 bytes, params: 2, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var items2;
|
|
var value5;
|
|
var binding;
|
|
const guild_id = guildScheduledEvent.guild_id;
|
|
var value;
|
|
const value3 = currentUserIsEventCreator(guildScheduledEvent);
|
|
if (value3) {
|
|
r0 = !value3;
|
|
} else {
|
|
items2 = [GuildScheduledEventStatus.CANCELED];
|
|
items2[1] = GuildScheduledEventStatus.COMPLETED;
|
|
value5 = items2.includes(guildScheduledEvent.status);
|
|
if (value5) {
|
|
binding = env0_79;
|
|
value = binding.get(guild_id, ReadStateTypes.GUILD_EVENT);
|
|
value.handleGuildEventRemoval(guild_id, guildScheduledEvent.id);
|
|
r1 = undefined;
|
|
} else {
|
|
r1 = !!value5;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function GUILD_SCHEDULED_EVENT_DELETE_39373({guildScheduledEvent}) { // fn#39373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:47055, offset: 0x010e07f4, size: 84 bytes, params: 2, frame: 16
|
|
const guild_id = guildScheduledEvent.guild_id;
|
|
if (currentUserIsEventCreator(guildScheduledEvent)) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const guild_id2 = guildScheduledEvent.guild_id;
|
|
const GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
const value = Reflect.apply(get, binding, [guild_id2, GUILD_EVENT]);
|
|
value.handleGuildEventRemoval(guild_id, guildScheduledEvent.id);
|
|
}
|
|
|
|
function GUILD_DELETE_39374({guild}) { // fn#39374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:47259, offset: 0x010e0848, size: 44 bytes, params: 2, frame: 13
|
|
const binding = env0_79;
|
|
const clear = binding.clear;
|
|
const id = guild.id;
|
|
const GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
return Reflect.apply(clear, binding, [id, GUILD_EVENT]);
|
|
}
|
|
|
|
function GUILD_UPDATE_39375({guild}) { // fn#39375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:47348, offset: 0x010e0874, size: 74 bytes, params: 2, frame: 15
|
|
var value;
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
const latest_onboarding_question_id = guild.latest_onboarding_question_id;
|
|
if (latest_onboarding_question_id != null) {
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = guild.id;
|
|
value = Reflect.apply(get, binding, [id, ReadStateTypes.GUILD_ONBOARDING_QUESTION]);
|
|
id = guild.id;
|
|
value._guildId = id;
|
|
value.lastMessageId = latest_onboarding_question_id;
|
|
}
|
|
}
|
|
|
|
function CHANNEL_RTC_UPDATE_CHAT_OPEN(a0) { // fn#39377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:47701, offset: 0x010e0906, size: 85 bytes, params: 2, frame: 14
|
|
if (a0.chatOpen) {
|
|
return tryAck({section: AnalyticsSections.CHANNEL, object: AnalyticsObjects.ACK_CHANNEL_RTC_UPDATE_CHAT_OPEN,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}, a0.channelId);
|
|
}
|
|
}
|
|
|
|
function NOTIFICATION_CENTER_ITEM_CREATE({item}) { // fn#39378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:47944, offset: 0x010e095b, size: 148 bytes, params: 2, frame: 18
|
|
var mentionCount;
|
|
const id = UserStore.getCurrentUser()?.id;
|
|
if (id == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
const value4 = Reflect.apply(get, binding, [id, NOTIFICATION_CENTER]);
|
|
value4.lastMessageId = item.id;
|
|
if (NotificationCenterItemsStore.tabFocused) {
|
|
handleNonChannelAck(id, ReadStateTypes.NOTIFICATION_CENTER, item.id, false);
|
|
} else {
|
|
mentionCount = value4.mentionCount;
|
|
value4.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
}
|
|
}
|
|
|
|
function RELATIONSHIP_ADD_39379(a0) { // fn#39379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:48229, offset: 0x010e09ef, size: 441 bytes, params: 2, frame: 20
|
|
var time;
|
|
var r2;
|
|
var FRIEND;
|
|
var binding;
|
|
var value3;
|
|
var value4;
|
|
var Date;
|
|
var value5;
|
|
var date;
|
|
var value8;
|
|
var value9;
|
|
var defaultImport;
|
|
var mentionCount;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
let relationship = a0.relationship;
|
|
let since = relationship.since;
|
|
if (since == null) {
|
|
return false;
|
|
}
|
|
let type = a0.relationship.type;
|
|
const PENDING_INCOMING = RelationshipTypes.PENDING_INCOMING;
|
|
if (type === PENDING_INCOMING) {
|
|
binding = env0_79;
|
|
value3 = binding.get(currentUser.id, ReadStateTypes.NOTIFICATION_CENTER);
|
|
value4 = a0.relationship.type === RelationshipTypes.FRIEND;
|
|
Date = global.Date;
|
|
if (value4) {
|
|
value8 = global.Date.now();
|
|
value9 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
time = (date instanceof Object ? date : value9).getTime();
|
|
} else {
|
|
since = a0.relationship.since;
|
|
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(since);
|
|
time = (date instanceof Object ? date : value5).getTime();
|
|
}
|
|
if (value3.ackMessageId != null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r2 = defaultImport.extractTimestamp(value3.ackMessageId);
|
|
} else {
|
|
r2 = 0;
|
|
}
|
|
if (r2 < time) {
|
|
value3.lastMessageId = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).fromTimestamp(time);
|
|
if (NotificationCenterItemsStore.tabFocused) {
|
|
handleNonChannelAck(currentUser.id, ReadStateTypes.NOTIFICATION_CENTER, undefined, false);
|
|
} else {
|
|
mentionCount = value3.mentionCount;
|
|
if (value4) {
|
|
value3.mentionCount = typeof mentionCount === 'bigint' ? mentionCount - 1n : +mentionCount - 1;
|
|
} else {
|
|
value3.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
relationship = a0.relationship;
|
|
type = relationship.type;
|
|
FRIEND = RelationshipTypes.FRIEND;
|
|
if (type !== FRIEND) {
|
|
return false;
|
|
}
|
|
binding = env0_79;
|
|
value3 = binding.get(currentUser.id, ReadStateTypes.NOTIFICATION_CENTER);
|
|
relationship = a0.relationship;
|
|
type = relationship.type;
|
|
FRIEND = RelationshipTypes.FRIEND;
|
|
value4 = type === FRIEND;
|
|
Date = global.Date;
|
|
if (value4) {
|
|
value8 = global.Date.now();
|
|
value9 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
time = (date instanceof Object ? date : value9).getTime();
|
|
} else {
|
|
since = a0.relationship.since;
|
|
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(since);
|
|
time = (date instanceof Object ? date : value5).getTime();
|
|
}
|
|
if (value3.ackMessageId != null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r2 = defaultImport.extractTimestamp(value3.ackMessageId);
|
|
} else {
|
|
r2 = 0;
|
|
}
|
|
if (r2 < time) {
|
|
value3.lastMessageId = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).fromTimestamp(time);
|
|
if (NotificationCenterItemsStore.tabFocused) {
|
|
handleNonChannelAck(currentUser.id, ReadStateTypes.NOTIFICATION_CENTER, undefined, false);
|
|
} else {
|
|
mentionCount = value3.mentionCount;
|
|
if (value4) {
|
|
value3.mentionCount = typeof mentionCount === 'bigint' ? mentionCount - 1n : +mentionCount - 1;
|
|
} else {
|
|
value3.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function RELATIONSHIP_REMOVE_39380(a0) { // fn#39380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:48829, offset: 0x010e0ba8, size: 267 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var Math;
|
|
var value;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
let since = a0.relationship.since;
|
|
if (since == null) {
|
|
return false;
|
|
}
|
|
const type = a0.relationship.type;
|
|
const PENDING_INCOMING = RelationshipTypes.PENDING_INCOMING;
|
|
if (type !== PENDING_INCOMING) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const id = currentUser.id;
|
|
const NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
const value3 = Reflect.apply(get, binding, [id, NOTIFICATION_CENTER]);
|
|
const Date = global.Date;
|
|
since = a0.relationship.since;
|
|
const value4 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
const date = new Date(since);
|
|
const time = (date instanceof Object ? date : value4).getTime();
|
|
const ackMessageId = value3.ackMessageId;
|
|
const value7 = 0;
|
|
if (ackMessageId != null) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(value3.ackMessageId);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value7;
|
|
}
|
|
if (r2 <= time) {
|
|
Math = global.Math;
|
|
value3.mentionCount = Math.max(value7, value3.mentionCount - 1);
|
|
}
|
|
}
|
|
|
|
function NOTIFICATION_CENTER_ITEMS_ACK({ids, optimistic}) { // fn#39381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:49237, offset: 0x010e0cb3, size: 129 bytes, params: 2, frame: 17
|
|
if (optimistic) {
|
|
return false;
|
|
}
|
|
if (NotificationCenterItemsStore.active) {
|
|
return false;
|
|
}
|
|
const id = UserStore.getCurrentUser()?.id;
|
|
if (id == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
const env0_0 = Reflect.apply(get, binding, [id, NOTIFICATION_CENTER]);
|
|
ids.forEach(_fun39382);
|
|
}
|
|
|
|
function USER_NON_CHANNEL_ACK_39383({ackType, ackedId, local}) { // fn#39383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:49560, offset: 0x010e0d9f, size: 84 bytes, params: 2, frame: 20
|
|
const id = UserStore.getCurrentUser()?.id;
|
|
return id != null && handleNonChannelAck(id, ackType, ackedId, local);
|
|
}
|
|
|
|
function PASSIVE_UPDATE_V2_39384({channels}) { // fn#39384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:49737, offset: 0x010e0df3, size: 153 bytes, params: 2, frame: 20
|
|
var r2;
|
|
var r3;
|
|
var r10;
|
|
var r0;
|
|
var value5;
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value6;
|
|
var parseTimestampBinding;
|
|
var lastPinTimestamp;
|
|
var timestamp;
|
|
var lastMessageId;
|
|
var lastMessageId2;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
const value2 = _createForOfIteratorHelperLoose_39151(channels);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (done) {
|
|
r0 = false;
|
|
} else {
|
|
r2 = false;
|
|
r3 = value3;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
binding = env0_79;
|
|
get = binding.get;
|
|
id = value5.id;
|
|
value6 = Reflect.apply(get, binding, [id]);
|
|
parseTimestampBinding = parseTimestamp;
|
|
lastPinTimestamp = value5.lastPinTimestamp;
|
|
timestamp = parseTimestampBinding(lastPinTimestamp);
|
|
lastMessageId = value6.lastMessageId;
|
|
lastMessageId2 = value5.lastMessageId;
|
|
value7 = lastMessageId === lastMessageId2;
|
|
if (value7) {
|
|
lastPinTimestamp = value6.lastPinTimestamp;
|
|
value8 = lastPinTimestamp === timestamp;
|
|
r10 = value8;
|
|
} else {
|
|
r10 = value7;
|
|
}
|
|
if (r10) {
|
|
continue;
|
|
}
|
|
lastMessageId = value5.lastMessageId;
|
|
value6.lastMessageId = lastMessageId;
|
|
value6.lastPinTimestamp = timestamp;
|
|
value9 = true;
|
|
r2 = value9;
|
|
value10 = value2();
|
|
done = value10.done;
|
|
if (done) {
|
|
r0 = r2;
|
|
break;
|
|
}
|
|
r3 = value10;
|
|
continue;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function MESSAGE_REQUEST_ACK({ackedId}) { // fn#39387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:50260, offset: 0x010e0ec2, size: 129 bytes, params: 2, frame: 16
|
|
const id = UserStore.getCurrentUser()?.id;
|
|
if (id == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const MESSAGE_REQUESTS = ReadStateTypes.MESSAGE_REQUESTS;
|
|
const value = Reflect.apply(get, binding, [id, MESSAGE_REQUESTS]);
|
|
if (ackedId === value.ackMessageId) {
|
|
return false;
|
|
}
|
|
value.ackMessageId = ackedId;
|
|
value.ack({'messageId': null, 'isExplicitUserAction': true, 'trackAnalytics': false, messageId: ackedId});
|
|
}
|
|
|
|
function MESSAGE_REQUEST_CLEAR_ACK() { // fn#39388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:50549, offset: 0x010e0f43, size: 89 bytes, params: 1, frame: 15
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value3 = undefined;
|
|
const id = currentUser == null ? value3 : currentUser.id;
|
|
if (id == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_79;
|
|
const get = binding.get;
|
|
const MESSAGE_REQUESTS = ReadStateTypes.MESSAGE_REQUESTS;
|
|
const value = Reflect.apply(get, binding, [id, MESSAGE_REQUESTS]);
|
|
if (value.ackMessageId == null) {
|
|
return false;
|
|
}
|
|
value.ackMessageId = value3;
|
|
return value3;
|
|
}
|
|
|
|
function APP_STATE_UPDATE_39389({state}) { // fn#39389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:50767, offset: 0x010e0f9c, size: 103 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var tryAckBinding;
|
|
var object2;
|
|
var value;
|
|
const ACTIVE = AppStates.ACTIVE;
|
|
const value2 = state === ACTIVE;
|
|
if (value2) {
|
|
tryAckBinding = tryAck;
|
|
object2 = {};
|
|
object2.section = AnalyticsSections.CHANNEL;
|
|
object2.object = AnalyticsObjects.ACK_APP_FOREGROUND;
|
|
object2.objectType = AnalyticsObjectTypes.ACK_AUTOMATIC;
|
|
value = SelectedChannelStore.getChannelId();
|
|
value = tryAckBinding(object2, value);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun39156() { // fn#39156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4216, offset: 0x010d9f0d, size: 47 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'DECAY_READ_STATES'});
|
|
}
|
|
|
|
function* _fun39163(a0) { // fn#39163, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:4941, offset: 0x010da0c1, size: 230 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var binding2;
|
|
var property;
|
|
var value3;
|
|
var closure;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var error;
|
|
if (true) {
|
|
var env0_0;
|
|
value = environment.__proto__.__proto__;
|
|
if (env2_70.length === 0) {
|
|
if (a0 != null) {
|
|
a0();
|
|
}
|
|
} else {
|
|
var binding = env2_70;
|
|
env0_0 = binding.splice(0, 100);
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[46];
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
try {
|
|
value3 = binding(property);
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
try {
|
|
closure = _fun39164;
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = value3(closure);
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
yield value4;
|
|
try {
|
|
value5 = undefined;
|
|
value6 = false;
|
|
} catch (error) {
|
|
env2_70.length = 0;
|
|
env2_71 = false;
|
|
return undefined;
|
|
}
|
|
if (value6) {
|
|
return value5;
|
|
}
|
|
binding = env2_0;
|
|
var value7 = binding(env2_2[48]);
|
|
yield value7.timeoutPromise(1000);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_90(a0);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39169(a0) { // fn#39169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:23623, offset: 0x010da57f, size: 152 bytes, params: 2, frame: 14
|
|
var binding;
|
|
var value2;
|
|
if (isReadableType(a0.type)) {
|
|
binding = env1_79;
|
|
value2 = binding.get(a0.id);
|
|
value2._guildId = a0.guild_id;
|
|
value2.lastMessageId = a0.lastMessageId;
|
|
value2.lastPinTimestamp = parseTimestamp(a0.lastPinTimestamp);
|
|
value2._isResourceChannel = a0.hasFlag(ChannelFlags.IS_GUILD_RESOURCE_CHANNEL);
|
|
if (THREAD_CHANNEL_TYPES.has(a0.type)) {
|
|
value2.syncThreadSettings();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39171(a0) { // fn#39171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:23914, offset: 0x010da62f, size: 181 bytes, params: 2, frame: 18
|
|
var binding;
|
|
var value2;
|
|
var moduleValue;
|
|
if (isReadableType(a0.type)) {
|
|
binding = env1_79;
|
|
value2 = binding.get(a0.id);
|
|
value2.lastMessageId = a0.last_message_id;
|
|
value2.lastPinTimestamp = parseTimestamp(a0.last_pin_timestamp);
|
|
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
value2._isResourceChannel = moduleValue.hasFlag(a0.flags ?? 0, ChannelFlags.IS_GUILD_RESOURCE_CHANNEL);
|
|
if (THREAD_CHANNEL_TYPES.has(a0.type)) {
|
|
value2.syncThreadSettings();
|
|
}
|
|
}
|
|
}
|
|
|
|
function mergeActiveJoinedThreads(a0) { // fn#39173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:24203, owner: mergeForGuild.mergeActiveJoinedThreads, offset: 0x010da7e1, size: 40 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
const threads = a0.threads;
|
|
if (threads != null) {
|
|
threads.forEach(_fun39174);
|
|
}
|
|
}
|
|
|
|
function mergeGuildEvents(a0) { // fn#39175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:24670, owner: mergeForGuild.mergeGuildEvents, offset: 0x010da8f7, size: 228 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var binding;
|
|
var id;
|
|
var GUILD_EVENT;
|
|
var value3;
|
|
var get;
|
|
var value4;
|
|
var defaultImport;
|
|
var value5;
|
|
const guild_scheduled_events = a0.guild_scheduled_events;
|
|
const value = undefined;
|
|
if ((guild_scheduled_events == null ? value : guild_scheduled_events.length) !== 0) {
|
|
value3 = environment.__proto__;
|
|
binding = env1_79;
|
|
get = binding.get;
|
|
id = a0.id;
|
|
value4 = Reflect.apply(get, binding, [id, ReadStateTypes.GUILD_EVENT]);
|
|
id = a0.id;
|
|
value4._guildId = id;
|
|
} else {
|
|
binding = env1_79;
|
|
var getIfExists = binding.getIfExists;
|
|
id = a0.id;
|
|
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
if (Reflect.apply(getIfExists, binding, [id, GUILD_EVENT]) == null) {
|
|
return value;
|
|
}
|
|
binding = env1_79;
|
|
get = binding.get;
|
|
id = a0.id;
|
|
GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
value4 = Reflect.apply(get, binding, [id, GUILD_EVENT]);
|
|
value4._guildId = a0.id;
|
|
}
|
|
const env0_0 = 0;
|
|
const env0_1 = null;
|
|
if (value4._ackMessageId == null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value5 = defaultImport.fromTimestamp(value4.getAckTimestamp());
|
|
}
|
|
a0.guild_scheduled_events.forEach(_fun39176);
|
|
value4.lastMessageId = env0_1;
|
|
value4.mentionCount = env0_0;
|
|
return value;
|
|
}
|
|
|
|
function mergeNotificationCenter(a0) { // fn#39178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:25517, owner: mergeRelationships.mergeNotificationCenter, offset: 0x010daa68, size: 84 bytes, params: 2, frame: 15
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
return false;
|
|
}
|
|
const binding = env1_79;
|
|
const get = binding.get;
|
|
const id = currentUser.id;
|
|
const NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
const env0_0 = Reflect.apply(get, binding, [id, NOTIFICATION_CENTER]);
|
|
a0.forEach(_fun39179);
|
|
}
|
|
|
|
function _fun39185(a0) { // fn#39185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:27347, offset: 0x010db046, size: 79 bytes, params: 2, frame: 14
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const hasOpenedThread2 = env1_81.hasOpenedThread(a0);
|
|
if (hasOpenedThread2) {
|
|
r0 = hasOpenedThread2;
|
|
} else {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(a0, env0_0.ackMessageId);
|
|
value = value < 0;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun39191({messages, threads}) { // fn#39191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28234, offset: 0x010db193, size: 48 bytes, params: 2, frame: 12
|
|
messages.forEach(function(a0) {
|
|
mergeServerChannels(a0.map(_fun39193).filter(require(dependencyMap[60]).isNotNullish));
|
|
});
|
|
mergeServerChannels(threads);
|
|
}
|
|
|
|
function AutoAckableChannelTracker() { // fn#39204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:2546, offset: 0x010db58f, size: 35 bytes, params: 1, frame: 13
|
|
env1_8(this, AutoAckableChannelTracker);
|
|
this.channelWindowIds = {};
|
|
}
|
|
|
|
function value_39209(a0) { // fn#39209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:3174, offset: 0x010db6a5, size: 184 bytes, params: 2, frame: 22
|
|
var r3;
|
|
var value5;
|
|
var value6;
|
|
var property;
|
|
var property2;
|
|
var has;
|
|
var value7;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const _createForOfIteratorHelperLoose_39151Binding = _createForOfIteratorHelperLoose_39151;
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const value3 = _createForOfIteratorHelperLoose_39151Binding(defaultImport.entries(this.channelWindowIds));
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r3 = value4;
|
|
while (true) {
|
|
value5 = r3.value;
|
|
value6 = env1_7(value5, 2);
|
|
property = value6[0];
|
|
property2 = value6[1];
|
|
has = property2.has;
|
|
if (Reflect.apply(has, property2, [a0])) {
|
|
set.add(property);
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r3 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
const Array = global.Array;
|
|
return Array.from(set);
|
|
}
|
|
|
|
function value_39212(a0) { // fn#39212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:3790, offset: 0x010db811, size: 123 bytes, params: 2, frame: 19
|
|
var r2;
|
|
var value4;
|
|
var value5;
|
|
var property;
|
|
var value6;
|
|
const _createForOfIteratorHelperLoose_39151Binding = _createForOfIteratorHelperLoose_39151;
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const value2 = _createForOfIteratorHelperLoose_39151Binding(defaultImport.entries(this.channelWindowIds));
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value6) {
|
|
value4 = r2.value;
|
|
value5 = env1_7(value4, 2);
|
|
property = value5[0];
|
|
a0(property, value5[1]);
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function ReadState(a0) { // fn#39214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:6949, offset: 0x010dbd45, size: 222 bytes, params: 2, frame: 15
|
|
let value = a1;
|
|
const r3 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
env1_8(this, ReadState);
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
this.type = CHANNEL;
|
|
this.outgoingAckTimer = null;
|
|
this.ackMessageIdAtChannelSelect = null;
|
|
this.ackedWhileCached = undefined;
|
|
this.channelId = a0;
|
|
this.type = r3;
|
|
this._guildId = null;
|
|
this._isThread = false;
|
|
this._isActiveThread = false;
|
|
this._isJoinedThread = false;
|
|
this._isResourceChannel = false;
|
|
this._persisted = false;
|
|
this.loadedMessages = false;
|
|
this._lastMessageId = null;
|
|
this._lastMessageTimestamp = 0;
|
|
this._ackMessageId = null;
|
|
this._ackMessageTimestamp = 0;
|
|
this.isManualAck = false;
|
|
this.ackPinTimestamp = 0;
|
|
this.lastPinTimestamp = 0;
|
|
this._oldestUnreadMessageId = null;
|
|
this.oldestUnreadMessageIdStale = false;
|
|
this.estimated = false;
|
|
this._unreadCount = 0;
|
|
this._mentionCount = 0;
|
|
this.outgoingAck = null;
|
|
}
|
|
|
|
function value_39215(a0) { // fn#39215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:7665, offset: 0x010dbe23, size: 344 bytes, params: 2, frame: 24
|
|
const channelId = this.channelId;
|
|
const type = this.type;
|
|
const _guildId = this._guildId;
|
|
const _isThread = this._isThread;
|
|
const _isActiveThread = this._isActiveThread;
|
|
const _isJoinedThread = this._isJoinedThread;
|
|
const _persisted = this._persisted;
|
|
const loadedMessages = this.loadedMessages;
|
|
const _lastMessageId = this._lastMessageId;
|
|
const _lastMessageTimestamp = this._lastMessageTimestamp;
|
|
const _ackMessageId = this._ackMessageId;
|
|
const _ackMessageTimestamp = this._ackMessageTimestamp;
|
|
const ackPinTimestamp = this.ackPinTimestamp;
|
|
const isManualAck = this.isManualAck;
|
|
const lastPinTimestamp = this.lastPinTimestamp;
|
|
const _oldestUnreadMessageId = this._oldestUnreadMessageId;
|
|
const oldestUnreadMessageIdStale = this.oldestUnreadMessageIdStale;
|
|
const estimated = this.estimated;
|
|
const _mentionCount = this._mentionCount;
|
|
const flags = this.flags;
|
|
const lastViewed = this.lastViewed;
|
|
if (a0) {
|
|
return {channelId: channelId, type: type, _guildId: _guildId, _isThread: _isThread,
|
|
_isActiveThread: _isActiveThread, _isJoinedThread: _isJoinedThread, _persisted: _persisted,
|
|
loadedMessages: loadedMessages, _lastMessageId: _lastMessageId,
|
|
_lastMessageTimestamp: _lastMessageTimestamp,
|
|
_ackMessageId: _ackMessageId, _ackMessageTimestamp: _ackMessageTimestamp, ackPinTimestamp: ackPinTimestamp,
|
|
isManualAck: isManualAck, lastPinTimestamp: lastPinTimestamp,
|
|
_oldestUnreadMessageId: _oldestUnreadMessageId,
|
|
oldestUnreadMessageIdStale: oldestUnreadMessageIdStale, estimated: estimated, _mentionCount: _mentionCount,
|
|
flags: flags, lastViewed: lastViewed};
|
|
}
|
|
const object2 = {channelId: channelId, type: type, _guildId: _guildId, _persisted: _persisted,
|
|
_lastMessageId: _lastMessageId, _lastMessageTimestamp: _lastMessageTimestamp, _ackMessageId: _ackMessageId,
|
|
_ackMessageTimestamp: _ackMessageTimestamp, ackPinTimestamp: ackPinTimestamp,
|
|
lastPinTimestamp: lastPinTimestamp, _mentionCount: _mentionCount, flags: flags};
|
|
if (lastViewed != null && lastViewed > 0) {
|
|
object2.lastViewed = lastViewed;
|
|
}
|
|
if (_isThread) {
|
|
object2._isThread = _isThread;
|
|
object2._isActiveThread = _isActiveThread;
|
|
object2._isJoinedThread = _isJoinedThread;
|
|
}
|
|
return object2;
|
|
}
|
|
|
|
function value_39216({channelId, type, _guildId, _isThread, _isActiveJoinedThread, _isActiveThread, _isJoinedThread, _persisted, loadedMessages, _lastMessageId, _lastMessageTimestamp, _ackMessageId, _ackMessageTimestamp, ackPinTimestamp, isManualAck, lastPinTimestamp, _oldestUnreadMessageId, oldestUnreadMessageIdStale, estimated, _unreadCount, _mentionCount, flags, lastViewed}) { // fn#39216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:8811, offset: 0x010dbf7b, size: 485 bytes, params: 2, frame: 33
|
|
this.channelId = channelId;
|
|
this.type = type ?? ReadStateTypes.CHANNEL;
|
|
this._guildId = _guildId;
|
|
let value = _isThread != null;
|
|
let r19 = value && _isThread;
|
|
this._isThread = r19;
|
|
if (_isActiveJoinedThread != null) {
|
|
this._isActiveThread = _isActiveJoinedThread;
|
|
this._isJoinedThread = _isActiveJoinedThread;
|
|
} else {
|
|
value = _isActiveThread != null;
|
|
r19 = value && _isActiveThread;
|
|
this._isActiveThread = r19;
|
|
value = _isJoinedThread != null;
|
|
r19 = value && _isJoinedThread;
|
|
this._isJoinedThread = r19;
|
|
}
|
|
this._persisted = _persisted !== false;
|
|
this.loadedMessages = loadedMessages != null && loadedMessages;
|
|
this._lastMessageId = _lastMessageId;
|
|
this._lastMessageTimestamp = _lastMessageTimestamp;
|
|
this._ackMessageId = _ackMessageId;
|
|
this._ackMessageTimestamp = _ackMessageTimestamp;
|
|
this.ackPinTimestamp = ackPinTimestamp;
|
|
this.isManualAck = isManualAck != null && isManualAck;
|
|
this.lastPinTimestamp = lastPinTimestamp;
|
|
this._oldestUnreadMessageId = _oldestUnreadMessageId;
|
|
this.oldestUnreadMessageIdStale = oldestUnreadMessageIdStale != null && oldestUnreadMessageIdStale;
|
|
this.estimated = estimated != null && estimated;
|
|
this._unreadCount = _unreadCount ?? 0;
|
|
this._mentionCount = _mentionCount;
|
|
this.flags = flags;
|
|
this.lastViewed = lastViewed;
|
|
let _mentionChannels = ReadState._mentionChannels;
|
|
_mentionChannels.delete(this.channelId);
|
|
value = this._mentionCount > value;
|
|
if (value && this.canHaveMentions()) {
|
|
_mentionChannels = ReadState._mentionChannels;
|
|
_mentionChannels.add(this.channelId);
|
|
}
|
|
}
|
|
|
|
function value_39217() { // fn#39217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:10014, offset: 0x010dc160, size: 58 bytes, params: 1, frame: 11
|
|
var value;
|
|
var unreadsSentinel;
|
|
if (this._guildId != null) {
|
|
value = ReadState.getGuildSentinels(this._guildId);
|
|
unreadsSentinel = value.unreadsSentinel;
|
|
value.unreadsSentinel = typeof unreadsSentinel === 'bigint' ? unreadsSentinel + 1n : +unreadsSentinel + 1;
|
|
}
|
|
}
|
|
|
|
function set_39221(a0) { // fn#39221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:10340, offset: 0x010dc1c8, size: 69 bytes, params: 2, frame: 14
|
|
var r0;
|
|
this._lastMessageId = a0;
|
|
let value = 0;
|
|
if (a0 != null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(a0);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
this._lastMessageTimestamp = r0;
|
|
}
|
|
|
|
function set_39224(a0) { // fn#39224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:10587, offset: 0x010dc223, size: 69 bytes, params: 2, frame: 14
|
|
var r0;
|
|
this._ackMessageId = a0;
|
|
let value = 0;
|
|
if (a0 != null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(a0);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
this._ackMessageTimestamp = r0;
|
|
}
|
|
|
|
function set_39228(a0) { // fn#39228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:10966, offset: 0x010dc2cb, size: 140 bytes, params: 2, frame: 14
|
|
let r2 = this._mentionCount !== 0 && a0 !== 0;
|
|
r2 = !r2 ? this._mentionCount === a0 : r2;
|
|
if (!r2) {
|
|
this.incrementGuildUnreadsSentinel();
|
|
}
|
|
this._mentionCount = a0;
|
|
let _mentionChannels = ReadState._mentionChannels;
|
|
_mentionChannels.delete(this.channelId);
|
|
if (this._mentionCount > 0 && this.canHaveMentions()) {
|
|
_mentionChannels = ReadState._mentionChannels;
|
|
_mentionChannels.add(this.channelId);
|
|
}
|
|
}
|
|
|
|
function get_39229() { // fn#39229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:11270, offset: 0x010dc357, size: 55 bytes, params: 1, frame: 4
|
|
var r0;
|
|
var IS_MENTION_LOW_IMPORTANCE;
|
|
var value2;
|
|
let flags = this.flags;
|
|
let value = flags != null;
|
|
if (value) {
|
|
flags = this.flags;
|
|
value = environment.__proto__;
|
|
IS_MENTION_LOW_IMPORTANCE = env1_78.IS_MENTION_LOW_IMPORTANCE;
|
|
value2 = flags & IS_MENTION_LOW_IMPORTANCE;
|
|
IS_MENTION_LOW_IMPORTANCE = env1_78.IS_MENTION_LOW_IMPORTANCE;
|
|
value = value2 === IS_MENTION_LOW_IMPORTANCE;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function set_39230(a0) { // fn#39230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:11384, offset: 0x010dc38e, size: 128 bytes, params: 2, frame: 4
|
|
var r2;
|
|
var flags;
|
|
var value;
|
|
var _mentionCount;
|
|
if (a0) {
|
|
_mentionCount = this._mentionCount;
|
|
value = 0;
|
|
if (value === _mentionCount) {
|
|
r2 = this.flags ?? value;
|
|
value = environment.__proto__;
|
|
this.flags = r2 | env1_78.IS_MENTION_LOW_IMPORTANCE;
|
|
}
|
|
} else {
|
|
flags = this.flags;
|
|
value = flags != null;
|
|
if (value && this.flags !== 0) {
|
|
flags = this.flags;
|
|
value = environment.__proto__;
|
|
this.flags = flags & ~env1_78.IS_MENTION_LOW_IMPORTANCE;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39231() { // fn#39231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:11618, offset: 0x010dc40e, size: 147 bytes, params: 1, frame: 16
|
|
var mentionCount;
|
|
const messages = MessageStore.getMessages(this.channelId);
|
|
if (this.ackMessageId == null) {
|
|
if (this.isPrivate()) {
|
|
if (messages.hasMoreAfter) {
|
|
return this.ackMessageId;
|
|
}
|
|
if (this.hasMentions()) {
|
|
var env0_0 = null;
|
|
mentionCount = this.mentionCount;
|
|
var env0_2 = UserStore.getCurrentUser();
|
|
messages.forEach(_fun39232, this, true);
|
|
return env0_0;
|
|
}
|
|
return this.lastMessageId;
|
|
}
|
|
}
|
|
return this.ackMessageId;
|
|
}
|
|
|
|
function value_39234() { // fn#39234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:12152, offset: 0x010dc544, size: 69 bytes, params: 1, frame: 12
|
|
var r0;
|
|
const type = this.type;
|
|
let value = environment.__proto__;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type !== CHANNEL) {
|
|
return false;
|
|
}
|
|
const getChannel = ChannelStore.getChannel;
|
|
const value2 = Reflect.apply(getChannel, ChannelStore, [this.channelId]) != null;
|
|
if (value2) {
|
|
value = value.isPrivate();
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39235(a0) { // fn#39235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:12298, offset: 0x010dc589, size: 315 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var r4;
|
|
var hasPresent2;
|
|
let value = a0;
|
|
const value2 = a1;
|
|
const r7 = value2 !== undefined ? value2 : false;
|
|
var env0_2;
|
|
var env0_3;
|
|
var env0_4;
|
|
var env0_5;
|
|
var env0_6;
|
|
let r6 = value ?? this._ackMessageId;
|
|
r6 = r6 ?? this.guessAckMessageId();
|
|
this.ackMessageId = r6;
|
|
this.isManualAck = value != null;
|
|
this.oldestUnreadMessageId = null;
|
|
this.estimated = false;
|
|
this.unreadCount = 0;
|
|
if (r7) {
|
|
this.mentionCount = 0;
|
|
}
|
|
if (this.hasUnread()) {
|
|
value = environment.__proto__;
|
|
env0_2 = UserStore.getCurrentUser();
|
|
env0_3 = this.getAckTimestamp();
|
|
env0_4 = false;
|
|
env0_5 = false;
|
|
env0_6 = null;
|
|
value = MessageStore.getMessages(this.channelId);
|
|
value.forAll(_fun39236);
|
|
hasPresent2 = value.hasPresent();
|
|
r4 = hasPresent2 ? !(env0_4 || env0_5) && value.length === this.unreadCount : !hasPresent2;
|
|
this.estimated = r4;
|
|
r4 = this._oldestUnreadMessageId ?? env0_6;
|
|
this.oldestUnreadMessageId = r4;
|
|
}
|
|
if (a2 != null) {
|
|
this.mentionCount = a2;
|
|
}
|
|
}
|
|
|
|
function value_39237(a0, a1) { // fn#39237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:13106, offset: 0x010dc797, size: 193 bytes, params: 3, frame: 20
|
|
var environment;
|
|
var guildScheduledEventsForGuild;
|
|
var ackTimestamp;
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (!(defaultImport.compare(this.ackMessageId, a1) >= 0)) {
|
|
guildScheduledEventsForGuild = GuildScheduledEventStore.getGuildScheduledEventsForGuild(a0);
|
|
ackTimestamp = this.getAckTimestamp();
|
|
if (!global.isNaN(ackTimestamp)) {
|
|
if (this._ackMessageId == null) {
|
|
value = defaultImport;
|
|
value = value.fromTimestamp(ackTimestamp);
|
|
}
|
|
var env0_1 = null;
|
|
var env0_2 = 0;
|
|
guildScheduledEventsForGuild.forEach(_fun39238);
|
|
this.lastMessageId = env0_1;
|
|
this.mentionCount = env0_2;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39239() { // fn#39239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:13499, offset: 0x010dc8de, size: 227 bytes, params: 1, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
var isChannelGated2;
|
|
var defaultImport;
|
|
const type = this.type;
|
|
const value = environment.__proto__;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type !== CHANNEL) {
|
|
return true;
|
|
}
|
|
if (this._isThread) {
|
|
if (this._isActiveThread) {
|
|
if (this._isResourceChannel) {
|
|
return false;
|
|
}
|
|
value2 = ChannelStore.getBasicChannel(this.channelId);
|
|
value3 = value2 != null;
|
|
if (value3) {
|
|
if ('basicPermissions' in value2) {
|
|
defaultImport = importDefault(3792) /* metro dependency 3792: BasicPermissionUtils */;
|
|
r1 = defaultImport.has(value2.basicPermissions, BasicPermissions.VIEW_CHANNEL);
|
|
} else {
|
|
isChannelGated2 = GatedChannelStore.isChannelGated(this.guildId, this.channelId);
|
|
r1 = isChannelGated2 ? PermissionStore.can(Permissions.VIEW_CHANNEL, value2) : !isChannelGated2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
return false;
|
|
}
|
|
if (this._isResourceChannel) {
|
|
return false;
|
|
}
|
|
value2 = ChannelStore.getBasicChannel(this.channelId);
|
|
value3 = value2 != null;
|
|
if (value3) {
|
|
if ('basicPermissions' in value2) {
|
|
defaultImport = importDefault(3792) /* metro dependency 3792: BasicPermissionUtils */;
|
|
r1 = defaultImport.has(value2.basicPermissions, BasicPermissions.VIEW_CHANNEL);
|
|
} else {
|
|
isChannelGated2 = GatedChannelStore.isChannelGated(this.guildId, this.channelId);
|
|
r1 = isChannelGated2 ? PermissionStore.can(Permissions.VIEW_CHANNEL, value2) : !isChannelGated2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39240() { // fn#39240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:13859, offset: 0x010dc9c1, size: 236 bytes, params: 1, frame: 17
|
|
var value;
|
|
var moduleValue;
|
|
var isMessageRequestOrSpamRequest;
|
|
var channelId;
|
|
var items2;
|
|
var moduleValue2;
|
|
if (this._isThread) {
|
|
if (this._isJoinedThread) {
|
|
value = environment.__proto__;
|
|
moduleValue = require(12371) /* metro dependency 12371: MessageRequestUtils */;
|
|
isMessageRequestOrSpamRequest = moduleValue.isMessageRequestOrSpamRequest;
|
|
channelId = this.channelId;
|
|
items2 = [MessageRequestStore];
|
|
items2[1] = SpamMessageRequestStore;
|
|
if (Reflect.apply(isMessageRequestOrSpamRequest, moduleValue, [channelId, items2])) {
|
|
return false;
|
|
}
|
|
if (this._isThread) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
moduleValue2 = require(5102) /* metro dependency 5102: isOptInEnabled */;
|
|
if (moduleValue2.isOptInEnabledForGuild(this._guildId)) {
|
|
if (this._lastMessageTimestamp < env1_75) {
|
|
return false;
|
|
}
|
|
if (UserGuildSettingsStore.isChannelOrParentOptedIn(this._guildId, this.channelId)) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
if (this.hasRecentlyVisitedAndRead()) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
if (this.hasMentions()) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
return false;
|
|
}
|
|
return this.canTrackUnreads();
|
|
}
|
|
return false;
|
|
}
|
|
moduleValue = require(12371) /* metro dependency 12371: MessageRequestUtils */;
|
|
isMessageRequestOrSpamRequest = moduleValue.isMessageRequestOrSpamRequest;
|
|
channelId = this.channelId;
|
|
items2 = [MessageRequestStore];
|
|
items2[1] = SpamMessageRequestStore;
|
|
if (Reflect.apply(isMessageRequestOrSpamRequest, moduleValue, [channelId, items2])) {
|
|
return false;
|
|
}
|
|
if (!this._isThread) {
|
|
moduleValue2 = require(5102) /* metro dependency 5102: isOptInEnabled */;
|
|
if (moduleValue2.isOptInEnabledForGuild(this._guildId)) {
|
|
if (this._lastMessageTimestamp < env1_75) {
|
|
return false;
|
|
}
|
|
if (UserGuildSettingsStore.isChannelOrParentOptedIn(this._guildId, this.channelId)) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
if (this.hasRecentlyVisitedAndRead()) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
if (this.hasMentions()) {
|
|
return this.canTrackUnreads();
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
return this.canTrackUnreads();
|
|
}
|
|
|
|
function value_39241() { // fn#39241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:14292, offset: 0x010dcaad, size: 197 bytes, params: 1, frame: 19
|
|
var r1;
|
|
var r3;
|
|
var r2;
|
|
var r0;
|
|
var moduleValue;
|
|
var isMessageRequestOrSpamRequest2;
|
|
var moduleValue2;
|
|
let value = this.mentionCount !== 0;
|
|
if (value) {
|
|
r1 = this._isThread && !this._isJoinedThread;
|
|
value = !r1;
|
|
if (r1) {
|
|
r1 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
moduleValue = require(12371) /* metro dependency 12371: MessageRequestUtils */;
|
|
isMessageRequestOrSpamRequest2 = moduleValue.isMessageRequestOrSpamRequest(this.channelId,
|
|
[MessageRequestStore,
|
|
SpamMessageRequestStore]);
|
|
if (isMessageRequestOrSpamRequest2) {
|
|
r2 = !isMessageRequestOrSpamRequest2;
|
|
} else {
|
|
moduleValue2 = require(5102) /* metro dependency 5102: isOptInEnabled */;
|
|
r3 = moduleValue2.isOptInEnabledForGuild(this._guildId) && this._lastMessageTimestamp < env1_75;
|
|
r3 = !r3 && this.canTrackUnreads();
|
|
r2 = r3;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39242(a0, a1, a2, a3, a4) { // fn#39242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:14593, offset: 0x010dcb72, size: 362 bytes, params: 6, frame: 16
|
|
var r0;
|
|
var _lastMessageTimestamp;
|
|
var value;
|
|
var defaultImport;
|
|
var object2;
|
|
if (a1) {
|
|
_lastMessageTimestamp = this._lastMessageTimestamp;
|
|
value = environment.__proto__;
|
|
if (_lastMessageTimestamp < env1_75) {
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (UserGuildSettingsStore.isChannelRecordOrParentOptedIn(a0)) {
|
|
value = environment.__proto__;
|
|
if ('basicPermissions' in a0) {
|
|
defaultImport = importDefault(3792) /* metro dependency 3792: BasicPermissionUtils */;
|
|
if (defaultImport.has(a0.basicPermissions, BasicPermissions.VIEW_CHANNEL)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (GatedChannelStore.isChannelGated(this.guildId, this.channelId)) {
|
|
if (PermissionStore.can(Permissions.VIEW_CHANNEL, a0)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
if (this.hasRecentlyVisitedAndRead()) {
|
|
value = environment.__proto__;
|
|
if ('basicPermissions' in a0) {
|
|
defaultImport = importDefault(3792) /* metro dependency 3792: BasicPermissionUtils */;
|
|
if (defaultImport.has(a0.basicPermissions, BasicPermissions.VIEW_CHANNEL)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (GatedChannelStore.isChannelGated(this.guildId, this.channelId)) {
|
|
if (PermissionStore.can(Permissions.VIEW_CHANNEL, a0)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
if (this.mentionCount <= 0) {
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
}
|
|
value = environment.__proto__;
|
|
if ('basicPermissions' in a0) {
|
|
defaultImport = importDefault(3792) /* metro dependency 3792: BasicPermissionUtils */;
|
|
if (defaultImport.has(a0.basicPermissions, BasicPermissions.VIEW_CHANNEL)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (GatedChannelStore.isChannelGated(this.guildId, this.channelId)) {
|
|
if (PermissionStore.can(Permissions.VIEW_CHANNEL, a0)) {
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false,
|
|
isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
return {'mentionCount': 0, 'unread': false, 'isMentionLowImportance': false};
|
|
}
|
|
if (a3) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false, isMentionLowImportance: this.isMentionLowImportance};
|
|
} else if (a4) {
|
|
r0 = {mentionCount: this.mentionCount, unread: false, isMentionLowImportance: this.isMentionLowImportance};
|
|
} else {
|
|
object2 = {};
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.unread = this.getAckTimestamp() < this._lastMessageTimestamp;
|
|
object2.isMentionLowImportance = this.isMentionLowImportance;
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39244() { // fn#39244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:15525, offset: 0x010dccf5, size: 97 bytes, params: 1, frame: 13
|
|
var value2;
|
|
let value = this._lastMessageTimestamp > 0;
|
|
let r0 = value && this._ackMessageId != null;
|
|
if (r0) {
|
|
value = this.getAckTimestamp();
|
|
value2 = environment.__proto__;
|
|
value = value > env1_76;
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
value = environment.__proto__;
|
|
value = UserSettingsProtoStore.getGuildRecentsDismissedAt(this._guildId);
|
|
value = value < this.getAckTimestamp();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39249() { // fn#39249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:16034, offset: 0x010dcdb0, size: 158 bytes, params: 1, frame: 16
|
|
var environment;
|
|
let value = a0;
|
|
const r3 = value !== undefined ? value : null;
|
|
const type = this.type;
|
|
value = environment.__proto__;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type === CHANNEL) {
|
|
if (this.canTrackUnreads()) {
|
|
if (r3 != null) {
|
|
value = parseTimestamp(r3);
|
|
this.ackPinTimestamp = value !== 0 ? value : this.lastPinTimestamp;
|
|
return true;
|
|
}
|
|
if (this.lastPinTimestamp === this.ackPinTimestamp) {
|
|
return false;
|
|
}
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39250);
|
|
value = parseTimestamp(r3);
|
|
this.ackPinTimestamp = value !== 0 ? value : this.lastPinTimestamp;
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function value_39251({messageId, location, trackAnalytics, local, immediate, force, isExplicitUserAction}) { // fn#39251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:16420, offset: 0x010dcea4, size: 329 bytes, params: 2, frame: 23
|
|
var environment;
|
|
var r0;
|
|
var r4;
|
|
var hasMentions;
|
|
var value2;
|
|
var value3;
|
|
var lastMessageId;
|
|
var value5;
|
|
var value6;
|
|
local = !(local === undefined) && local;
|
|
immediate = !(immediate === undefined) && immediate;
|
|
force = !(force === undefined) && force;
|
|
isExplicitUserAction = !(isExplicitUserAction === undefined) && isExplicitUserAction;
|
|
if (this._shouldAck(force, local, isExplicitUserAction)) {
|
|
if (force) {
|
|
hasMentions = this.hasMentions();
|
|
this.estimated = false;
|
|
this.snapshot = this.takeSnapshot();
|
|
value2 = 0;
|
|
this.unreadCount = value2;
|
|
this.mentionCount = value2;
|
|
this.isMentionLowImportance = false;
|
|
value3 = messageId != null;
|
|
if (value3) {
|
|
r0 = value3;
|
|
r4 = messageId;
|
|
} else {
|
|
lastMessageId = this.lastMessageId;
|
|
r0 = lastMessageId != null;
|
|
r4 = lastMessageId;
|
|
}
|
|
if (r0) {
|
|
this.ackMessageId = r4;
|
|
this.isManualAck = false;
|
|
value5 = true;
|
|
this._persisted = value5;
|
|
value6 = environment.__proto__;
|
|
if (env1_69) {
|
|
this.ackedWhileCached = value5;
|
|
}
|
|
tryAckParentForumChannel(this.channelId);
|
|
if (local) {
|
|
this.oldestUnreadMessageId = null;
|
|
r0 = value5;
|
|
} else {
|
|
if (this.outgoingAck == null) {
|
|
this.outgoingAckTimer = global.setTimeout(_fun39252, hasMentions || immediate ? value2 : 3000);
|
|
}
|
|
this.outgoingAck = r4;
|
|
r0 = value5;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
if (this.canTrackUnreads()) {
|
|
hasMentions = this.hasMentions();
|
|
this.estimated = false;
|
|
this.snapshot = this.takeSnapshot();
|
|
value2 = 0;
|
|
this.unreadCount = value2;
|
|
this.mentionCount = value2;
|
|
this.isMentionLowImportance = false;
|
|
value3 = messageId != null;
|
|
if (value3) {
|
|
r0 = value3;
|
|
r4 = messageId;
|
|
} else {
|
|
lastMessageId = this.lastMessageId;
|
|
r0 = lastMessageId != null;
|
|
r4 = lastMessageId;
|
|
}
|
|
if (r0) {
|
|
this.ackMessageId = r4;
|
|
this.isManualAck = false;
|
|
value5 = true;
|
|
this._persisted = value5;
|
|
value6 = environment.__proto__;
|
|
if (env1_69) {
|
|
this.ackedWhileCached = value5;
|
|
}
|
|
tryAckParentForumChannel(this.channelId);
|
|
if (local) {
|
|
this.oldestUnreadMessageId = null;
|
|
r0 = value5;
|
|
} else {
|
|
if (this.outgoingAck == null) {
|
|
this.outgoingAckTimer = global.setTimeout(_fun39252, hasMentions || immediate ? value2 : 3000);
|
|
}
|
|
this.outgoingAck = r4;
|
|
r0 = value5;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function value_39253() { // fn#39253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:17213, offset: 0x010dd04c, size: 142 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
const property = (require(5214) /* metro dependency 5214: GuildReadStateStore */).default;
|
|
const guildId = this.guildId;
|
|
const object2 = {};
|
|
object2.unread = this.hasUnread();
|
|
object2.mentionCount = this.mentionCount;
|
|
value = null;
|
|
object2.guildUnread = value == guildId ? value : property.hasUnread(guildId);
|
|
object2.guildMentionCount = value == guildId ? value : property.getMentionCount(guildId);
|
|
const Date = global.Date;
|
|
object2.takenAt = Date.now();
|
|
return object2;
|
|
}
|
|
|
|
function value_39255(a0, a1, a2) { // fn#39255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:17622, offset: 0x010dd10e, size: 146 bytes, params: 4, frame: 16
|
|
var r4;
|
|
var r5;
|
|
var r3;
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var isManualAck;
|
|
var type;
|
|
var value3;
|
|
let value = !!a0;
|
|
if (a0) {
|
|
r0 = value;
|
|
} else {
|
|
value = !!a2;
|
|
if (a2) {
|
|
r1 = value;
|
|
} else {
|
|
value = !!a1;
|
|
if (a1) {
|
|
r2 = value;
|
|
} else {
|
|
isManualAck = this.isManualAck;
|
|
value = !isManualAck;
|
|
if (isManualAck) {
|
|
r3 = value;
|
|
} else {
|
|
type = this.type;
|
|
value = environment.__proto__;
|
|
r4 = type !== ReadStateTypes.CHANNEL || this.loadedMessages;
|
|
if (!r4) {
|
|
value = ChannelStore.getChannel(this.channelId);
|
|
value3 = value != null;
|
|
if (value3) {
|
|
value = value.isForumLikeChannel();
|
|
r5 = value;
|
|
} else {
|
|
r5 = value3;
|
|
}
|
|
r4 = r5;
|
|
}
|
|
value = !!r4;
|
|
r3 = value;
|
|
}
|
|
r2 = r3;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39256(a0, a1) { // fn#39256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:17820, offset: 0x010dd1a0, size: 157 bytes, params: 3, frame: 14
|
|
var environment;
|
|
var r2;
|
|
var value;
|
|
var value2;
|
|
const env0_1 = a0;
|
|
const env0_2 = a1;
|
|
if (this.outgoingAck != null) {
|
|
value = environment.__proto__;
|
|
var env0_4 = AuthenticationStore.getId();
|
|
this._persisted = true;
|
|
value2 = this.recalculateFlags();
|
|
r2 = value2 === this.flags ? undefined : value2;
|
|
value = importDefault(12370) /* metro dependency 12370: networkAwareRetry */;
|
|
value = value(_fun39257);
|
|
value.then(_fun39258);
|
|
}
|
|
}
|
|
|
|
function value_39260() { // fn#39260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18352, offset: 0x010dd3a2, size: 105 bytes, params: 1, frame: 12
|
|
const type = this.type;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type === CHANNEL) {
|
|
var channel = ChannelStore.getChannel(this.channelId);
|
|
if (channel != null) {
|
|
return channel.isThread() ? env1_78.IS_THREAD : channel.guild_id != null ? env1_78.IS_GUILD_CHANNEL : 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39261() { // fn#39261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18539, offset: 0x010dd40b, size: 194 bytes, params: 1, frame: 18
|
|
var environment;
|
|
const outgoingAck = this.outgoingAck;
|
|
const channelId = this.channelId;
|
|
const type = this.type;
|
|
if (outgoingAck != null) {
|
|
var value = environment.__proto__;
|
|
var GUILD_HOME = ReadStateTypes.GUILD_HOME;
|
|
if (GUILD_HOME === type) {
|
|
var env0_0 = Endpoints.GUILD_FEATURE_ACK(channelId, outgoingAck, type);
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39262);
|
|
return undefined;
|
|
}
|
|
var GUILD_EVENT = ReadStateTypes.GUILD_EVENT;
|
|
if (GUILD_EVENT === type) {
|
|
var env0_0 = Endpoints.GUILD_FEATURE_ACK(channelId, outgoingAck, type);
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39262);
|
|
return undefined;
|
|
}
|
|
var GUILD_ONBOARDING_QUESTION = ReadStateTypes.GUILD_ONBOARDING_QUESTION;
|
|
if (GUILD_ONBOARDING_QUESTION === type) {
|
|
var env0_0 = Endpoints.GUILD_FEATURE_ACK(channelId, outgoingAck, type);
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39262);
|
|
return undefined;
|
|
}
|
|
var NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
if (NOTIFICATION_CENTER === type) {
|
|
env0_0 = Endpoints.USER_NON_CHANNEL_ACK(outgoingAck, type);
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39262);
|
|
return undefined;
|
|
}
|
|
var MESSAGE_REQUESTS = ReadStateTypes.MESSAGE_REQUESTS;
|
|
if (MESSAGE_REQUESTS === type) {
|
|
env0_0 = Endpoints.USER_NON_CHANNEL_ACK(outgoingAck, type);
|
|
this._persisted = true;
|
|
(importDefault(12370) /* metro dependency 12370: networkAwareRetry */)(_fun39262);
|
|
return undefined;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39263() { // fn#39263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18973, offset: 0x010dd516, size: 436 bytes, params: 1, frame: 26
|
|
let value = a0;
|
|
let r2 = !(value !== undefined) || value;
|
|
value = environment.__proto__;
|
|
const getBasicChannel = ChannelStore.getBasicChannel;
|
|
let channelId = this.channelId;
|
|
const value2 = Reflect.apply(getBasicChannel, ChannelStore, [channelId]);
|
|
const binding = env1_63;
|
|
const log = binding.log;
|
|
channelId = this.channelId;
|
|
const type = this.type;
|
|
const object2 = {remote: r2};
|
|
object2.persisted = this._persisted;
|
|
object2.channelMissing = value2 == null;
|
|
object2.isOld = isOldReadState(this, generateOldThreadCutoff());
|
|
object2.validType = value2 != null && ALL_CHANNEL_TYPES.has(value2.type);
|
|
object2.readableType = value2 != null && isReadableType(value2.type);
|
|
object2.oldThreadCutoff = generateOldThreadCutoff();
|
|
object2.mentionCount = this.mentionCount;
|
|
object2.channelId = this.channelId;
|
|
object2.ackMessageId = this._ackMessageId;
|
|
object2.lastMessageId = this._lastMessageId;
|
|
Reflect.apply(log, binding, ['Deleting ReadState', channelId, type, object2]);
|
|
r2 = r2 && this._persisted;
|
|
if (r2) {
|
|
(require(507) /* metro dependency 507: HTTPUtils */).HTTP.del({url: Endpoints.CHANNEL_ACK(this.channelId),
|
|
body: {version: 2, read_state_type: this.type}, oldFormErrors: true, rejectWithError: true});
|
|
}
|
|
const value6 = ReadState._readStates.get(this.type);
|
|
if (value6 != null) {
|
|
value6.delete(this.channelId);
|
|
}
|
|
ReadState._mentionChannels.delete(this.channelId);
|
|
}
|
|
|
|
function value_39264(a0) { // fn#39264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:19741, offset: 0x010dd6ca, size: 492 bytes, params: 2, frame: 27
|
|
var r7;
|
|
var r8;
|
|
var r5;
|
|
var r4;
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
var isReadableType2;
|
|
var isPrivate2;
|
|
var value7;
|
|
var guildId;
|
|
var value15;
|
|
var defaultImport;
|
|
var cast;
|
|
let value = environment.__proto__;
|
|
if (GuildAvailabilityStore.totalUnavailableGuilds !== 0) {
|
|
return false;
|
|
}
|
|
let type = this.type;
|
|
if (type == null) {
|
|
value2 = ChannelStore.getBasicChannel(this.channelId);
|
|
} else {
|
|
type = this.type;
|
|
var CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type !== CHANNEL) {
|
|
type = this.type;
|
|
if (ReadStateTypes.GUILD_HOME === type) {
|
|
r0 = GuildStore.getGuild(this.channelId) != null;
|
|
} else if (ReadStateTypes.GUILD_EVENT === type) {
|
|
r0 = GuildStore.getGuild(this.channelId) != null;
|
|
} else if (ReadStateTypes.GUILD_ONBOARDING_QUESTION === type) {
|
|
r0 = GuildStore.getGuild(this.channelId) != null;
|
|
} else if (ReadStateTypes.NOTIFICATION_CENTER !== type) {
|
|
r0 = true;
|
|
} else {
|
|
value15 = undefined;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
cast = defaultImport.cast;
|
|
value = UserStore.getCurrentUser();
|
|
value = Reflect.apply(cast, defaultImport, [value == null ? value15 : value.id]);
|
|
value = value === this.channelId;
|
|
r0 = value;
|
|
}
|
|
return !r0;
|
|
}
|
|
value2 = ChannelStore.getBasicChannel(this.channelId);
|
|
}
|
|
if (value2 == null) {
|
|
r0 = !!isOldReadState(this, a0);
|
|
} else {
|
|
value3 = ALL_CHANNEL_TYPES.has(value2.type);
|
|
if (value3) {
|
|
isReadableType2 = isReadableType(value2.type);
|
|
if (isReadableType2) {
|
|
isPrivate2 = isPrivate(value2.type);
|
|
if (isPrivate2) {
|
|
r5 = !isPrivate2;
|
|
} else {
|
|
value7 = THREAD_CHANNEL_TYPES.has(value2.type);
|
|
if (value7) {
|
|
guildId = this.guildId;
|
|
r7 = guildId != null && ActiveThreadsStore.isActive(guildId, value2.parent_id, this.channelId);
|
|
r7 = !r7 && isOldReadState(this, a0);
|
|
r8 = !r7;
|
|
} else {
|
|
r8 = !value7;
|
|
}
|
|
r7 = r8 ? this.mentionCount > 0 && !PermissionStore.canBasicChannel(env1_65, value2) : !r8;
|
|
r5 = r7;
|
|
}
|
|
r4 = r5;
|
|
} else {
|
|
r4 = !isReadableType2;
|
|
}
|
|
r0 = r4;
|
|
} else {
|
|
r0 = !!value3;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39265() { // fn#39265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:20508, offset: 0x010dd8b6, size: 417 bytes, params: 1, frame: 16
|
|
var r4;
|
|
var r2;
|
|
var _isThread;
|
|
var value;
|
|
var guildJoinedAtTime;
|
|
if (this._ackMessageTimestamp === 0) {
|
|
_isThread = this._isThread;
|
|
value = environment.__proto__;
|
|
if (_isThread) {
|
|
this._ackMessageTimestamp = getThreadAckMessageTimestamp(this.guildId, this.channelId);
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
this._ackMessageId = value.fromTimestamp(this._ackMessageTimestamp);
|
|
return this._ackMessageTimestamp;
|
|
}
|
|
r4 = this.type === ReadStateTypes.GUILD_EVENT || this.type === ReadStateTypes.GUILD_ONBOARDING_QUESTION ? GuildStore.getGuild(this.channelId) : isStaticChannelRoute(this.channelId) ? GuildStore.getGuild(this.guildId) : ChannelStore.getChannel(this.channelId) != null ? GuildStore.getGuild(ChannelStore.getChannel(this.channelId).getGuildId()) : undefined;
|
|
if (r4 != null) {
|
|
guildJoinedAtTime = getGuildJoinedAtTime(r4);
|
|
if (global.isNaN(guildJoinedAtTime)) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(this.channelId);
|
|
r2 = value;
|
|
} else {
|
|
r2 = guildJoinedAtTime;
|
|
}
|
|
} else {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(this.channelId);
|
|
r2 = value;
|
|
}
|
|
this._ackMessageTimestamp = r2;
|
|
return r2;
|
|
}
|
|
if (global.isNaN(this._ackMessageTimestamp)) {
|
|
_isThread = this._isThread;
|
|
value = environment.__proto__;
|
|
if (_isThread) {
|
|
this._ackMessageTimestamp = getThreadAckMessageTimestamp(this.guildId, this.channelId);
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
this._ackMessageId = value.fromTimestamp(this._ackMessageTimestamp);
|
|
return this._ackMessageTimestamp;
|
|
}
|
|
r4 = this.type === ReadStateTypes.GUILD_EVENT || this.type === ReadStateTypes.GUILD_ONBOARDING_QUESTION ? GuildStore.getGuild(this.channelId) : isStaticChannelRoute(this.channelId) ? GuildStore.getGuild(this.guildId) : ChannelStore.getChannel(this.channelId) != null ? GuildStore.getGuild(ChannelStore.getChannel(this.channelId).getGuildId()) : undefined;
|
|
if (r4 != null) {
|
|
guildJoinedAtTime = getGuildJoinedAtTime(r4);
|
|
if (global.isNaN(guildJoinedAtTime)) {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(this.channelId);
|
|
r2 = value;
|
|
} else {
|
|
r2 = guildJoinedAtTime;
|
|
}
|
|
} else {
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(this.channelId);
|
|
r2 = value;
|
|
}
|
|
this._ackMessageTimestamp = r2;
|
|
return r2;
|
|
}
|
|
return this._ackMessageTimestamp;
|
|
}
|
|
|
|
function get_39266() { // fn#39266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:21285, offset: 0x010dda57, size: 64 bytes, params: 1, frame: 13
|
|
var r0;
|
|
const oldestUnreadMessageId = this.oldestUnreadMessageId;
|
|
let value = 0;
|
|
if (oldestUnreadMessageId != null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.extractTimestamp(this.oldestUnreadMessageId);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39267() { // fn#39267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:21426, offset: 0x010dda97, size: 188 bytes, params: 1, frame: 19
|
|
var binding;
|
|
const value = true;
|
|
this._isThread = value;
|
|
const channel = ChannelStore.getChannel(this.channelId);
|
|
if (channel == null) {
|
|
binding = env1_63;
|
|
binding.warn('syncThreadSettings called with channel not in memory ' + this.channelId);
|
|
return false;
|
|
}
|
|
const guildId = this.guildId;
|
|
const r5 = guildId != null && ActiveThreadsStore.isActive(guildId, channel.parent_id, this.channelId);
|
|
const hasJoined2 = JoinedThreadsStore.hasJoined(this.channelId);
|
|
let r2 = this._isActiveThread !== r5 || this._isJoinedThread !== hasJoined2;
|
|
if (r2) {
|
|
this._isActiveThread = r5;
|
|
this._isJoinedThread = hasJoined2;
|
|
r2 = value;
|
|
}
|
|
return r2;
|
|
}
|
|
|
|
function value_39268() { // fn#39268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:21841, offset: 0x010ddb53, size: 176 bytes, params: 1, frame: 17
|
|
const Math = global.Math;
|
|
const ceil = Math.ceil;
|
|
const Date = global.Date;
|
|
let value = Date.now();
|
|
const DISCORD_EPOCH = (require(21) /* metro dependency 21: SnowflakeUtils */).DISCORD_EPOCH;
|
|
value -= DISCORD_EPOCH;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const DAY = Millis.DAY;
|
|
value = Reflect.apply(ceil, Math, [value / DAY]);
|
|
if (value !== this.lastViewed) {
|
|
this.lastViewed = value;
|
|
value = this.canTrackUnreads();
|
|
if (value && !this.hasUnread()) {
|
|
this.ack({'force': true, 'trackAnalytics': false});
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39269(a0) { // fn#39269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:22074, offset: 0x010ddc03, size: 134 bytes, params: 2, frame: 18
|
|
var r2;
|
|
var r7;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
const value4 = _createForOfIteratorHelperLoose_39151(ReadState._readStates.values());
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r2 = value5;
|
|
while (true) {
|
|
_createForOfIteratorHelperLoose_39151Binding = _createForOfIteratorHelperLoose_39151;
|
|
value6 = r2.value;
|
|
value7 = _createForOfIteratorHelperLoose_39151Binding(value6.values());
|
|
value8 = value7();
|
|
done = value8.done;
|
|
if (!done) {
|
|
r7 = value8;
|
|
while (true) {
|
|
value9 = r7.value;
|
|
if (a0(value9) === false) {
|
|
break;
|
|
}
|
|
value10 = value7();
|
|
done = value10.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r7 = value10;
|
|
continue;
|
|
}
|
|
}
|
|
value11 = value4();
|
|
done = value11.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value11;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_39270(a0) { // fn#39270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:22300, offset: 0x010ddc89, size: 217 bytes, params: 2, frame: 17
|
|
var r4;
|
|
var readState;
|
|
var value7;
|
|
var map;
|
|
const value = a1;
|
|
const value2 = undefined;
|
|
const r5 = value !== value2 ? value : ReadStateTypes.CHANNEL;
|
|
let _readStates = ReadState._readStates;
|
|
const value3 = _readStates.get(r5);
|
|
let r0 = value3 == null ? value2 : value3.get(a0);
|
|
if (r0 == null) {
|
|
readState = new ReadState(a0, r5);
|
|
_readStates = ReadState._readStates;
|
|
value7 = _readStates.get(r5);
|
|
if (value7 != null) {
|
|
r4 = value7;
|
|
} else {
|
|
map = new global.Map();
|
|
}
|
|
r4.set(a0, readState);
|
|
_readStates = ReadState._readStates;
|
|
if (_readStates.has(r5)) {
|
|
r0 = readState;
|
|
} else {
|
|
ReadState._readStates.set(r5, r4);
|
|
r0 = readState;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39273(a0) { // fn#39273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:22849, offset: 0x010ddda6, size: 71 bytes, params: 2, frame: 12
|
|
var r0;
|
|
let value = a1;
|
|
const value2 = undefined;
|
|
value = ReadState._readStates.get(value !== value2 ? value : ReadStateTypes.CHANNEL);
|
|
if (value == null) {
|
|
r0 = value2;
|
|
} else {
|
|
value = value.get(a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39274() { // fn#39274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:22978, offset: 0x010ddded, size: 131 bytes, params: 1, frame: 17
|
|
var r2;
|
|
var value4;
|
|
var getIfExists;
|
|
var value5;
|
|
var canHaveMentions;
|
|
var push;
|
|
var value6;
|
|
const items2 = [];
|
|
const _createForOfIteratorHelperLoose_39151Binding = _createForOfIteratorHelperLoose_39151;
|
|
let _mentionChannels = ReadState._mentionChannels;
|
|
const value2 = _createForOfIteratorHelperLoose_39151Binding(_mentionChannels);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r2 = value3;
|
|
reducibleLoop1: while (true) {
|
|
value4 = r2.value;
|
|
getIfExists = ReadState.getIfExists;
|
|
value5 = Reflect.apply(getIfExists, ReadState, [value4]);
|
|
reducibleJoin5: while (true) {
|
|
reducibleJoin3: while (true) {
|
|
if (value5 == null) {
|
|
break reducibleJoin3;
|
|
}
|
|
canHaveMentions = value5.canHaveMentions;
|
|
if (Reflect.apply(canHaveMentions, value5, [])) {
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [value4]);
|
|
break reducibleJoin5;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
_mentionChannels = ReadState._mentionChannels;
|
|
_mentionChannels.delete(value4);
|
|
break reducibleJoin5;
|
|
}
|
|
value6 = value2();
|
|
done = value6.done;
|
|
if (done) {
|
|
break reducibleLoop1;
|
|
}
|
|
r2 = value6;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function value_39276(a0) { // fn#39276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:23332, offset: 0x010ddeab, size: 93 bytes, params: 2, frame: 13
|
|
const value = a1;
|
|
const value2 = ReadState._readStates.get(value !== undefined ? value : ReadStateTypes.CHANNEL);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
const value3 = value2.delete(a0);
|
|
if (value3) {
|
|
ReadState._mentionChannels.delete(a0);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
function ReadStateStoreClass() { // fn#39280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:29666, offset: 0x010de238, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_8(this, ReadStateStoreClass);
|
|
const value3 = env1_4(ReadStateStoreClass);
|
|
return env1_3(this, _isNativeReflectConstruct_39148() ? global.Reflect.construct(value3, arguments,
|
|
env1_4(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_39281() { // fn#39281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:29979, offset: 0x010de2a9, size: 338 bytes, params: 1, frame: 55
|
|
const property = (require(7030) /* metro dependency 7030: AppStateStore */).default;
|
|
const items2 = [DimensionStore];
|
|
items2[1] = UserStore;
|
|
items2[2] = GuildStore;
|
|
items2[3] = GuildAvailabilityStore;
|
|
items2[4] = ChannelStore;
|
|
items2[5] = SelectedChannelStore;
|
|
items2[6] = MessageStore;
|
|
items2[7] = PermissionStore;
|
|
items2[8] = ChannelRTCStore;
|
|
items2[9] = ActiveThreadsStore;
|
|
items2[10] = JoinedThreadsStore;
|
|
items2[11] = ChannelSectionStore;
|
|
items2[12] = GuildScheduledEventStore;
|
|
items2[13] = ExperimentStore;
|
|
items2[14] = GatedChannelStore;
|
|
items2[15] = UserGuildSettingsStore;
|
|
items2[16] = WindowStore;
|
|
items2[17] = NotificationCenterItemsStore;
|
|
items2[18] = MessageRequestStore;
|
|
items2[19] = UserSettingsProtoStore;
|
|
items2[20] = SpamMessageRequestStore;
|
|
items2.push(property);
|
|
this.waitFor(ActiveThreadsStore, AuthenticationStore, ChannelRTCStore, ChannelSectionStore, ChannelStore,
|
|
DimensionStore, EmbeddedActivitiesStore, GatedChannelStore, GuildAvailabilityStore, GuildScheduledEventStore,
|
|
GuildStore, IdleStore, JoinedThreadsStore, MessageStore, NotificationCenterItemsStore, PermissionStore,
|
|
RelationshipStore, SelectedChannelStore, UserGuildSettingsStore, UserSettingsProtoStore, UserStore, WindowStore);
|
|
this.syncWith([ChannelSectionStore], handleChannelSectionStoreUpdate);
|
|
}
|
|
|
|
function value_39282() { // fn#39282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30213, offset: 0x010de3fb, size: 69 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
const _readStates = env1_79._readStates;
|
|
const get = _readStates.get;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
return Reflect.apply(get, _readStates, [CHANNEL]) ?? new global.Map();
|
|
}
|
|
|
|
function value_39283(a0) { // fn#39283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30319, offset: 0x010de440, size: 46 bytes, params: 2, frame: 13
|
|
let value = a1;
|
|
const r3 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getIfExists(a0, r3);
|
|
}
|
|
|
|
function value_39284(a0) { // fn#39284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30410, offset: 0x010de46e, size: 34 bytes, params: 2, frame: 13
|
|
const binding = env1_79;
|
|
const getIfExists = binding.getIfExists;
|
|
const NOTIFICATION_CENTER = ReadStateTypes.NOTIFICATION_CENTER;
|
|
return Reflect.apply(getIfExists, binding, [a0, NOTIFICATION_CENTER]);
|
|
}
|
|
|
|
function value_39285(a0) { // fn#39285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30495, offset: 0x010de490, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canBeUnread() && a0.hasUnread();
|
|
}, false);
|
|
}
|
|
|
|
function value_39287(a0) { // fn#39287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30618, offset: 0x010de4e7, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canBeUnread() && a0.hasUnreadOrMentions();
|
|
}, false);
|
|
}
|
|
|
|
function value_39289(a0) { // fn#39289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30748, offset: 0x010de53e, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canTrackUnreads() && a0.hasUnread();
|
|
}, false);
|
|
}
|
|
|
|
function value_39291(a0) { // fn#39291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30873, offset: 0x010de595, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.isForumPostUnread();
|
|
}, false);
|
|
}
|
|
|
|
function value_39293(a0) { // fn#39293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:30982, offset: 0x010de5df, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canBeUnread() ? a0.unreadCount : 0;
|
|
}, 0);
|
|
}
|
|
|
|
function value_39295(a0) { // fn#39295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31101, offset: 0x010de634, size: 105 bytes, params: 2, frame: 19
|
|
var environment;
|
|
let value = a1;
|
|
const r7 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
const value2 = env1_79.getValue(a0, r7, function(a0) {
|
|
return a0.canHaveMentions() ? a0.getMentionCount() : 0;
|
|
}, 0);
|
|
return (importDefault(8876) /* metro dependency 8876: isChangelogChannel */)(a0) && value2 > 0 ? 1 : value2;
|
|
}
|
|
|
|
function value_39297(a0) { // fn#39297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31267, offset: 0x010de6bb, size: 76 bytes, params: 2, frame: 18
|
|
var environment;
|
|
let value = a1;
|
|
const r6 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
return r6 === CHANNEL && env1_79.getValue(a0, r6, function(a0) {
|
|
return a0.isMentionLowImportance;
|
|
}, false);
|
|
}
|
|
|
|
function value_39299(a0, a1, a2, a3, a4) { // fn#39299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31407, offset: 0x010de712, size: 93 bytes, params: 6, frame: 17
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const env0_3 = a3;
|
|
const env0_4 = a4;
|
|
const binding = env1_79;
|
|
const getValue = binding.getValue;
|
|
const id = a0.id;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
return Reflect.apply(getValue, binding, [id, CHANNEL, _fun39300, {'mentionCount': 0, 'unread': false,
|
|
'isMentionLowImportance': false}]);
|
|
}
|
|
|
|
function value_39301(a0) { // fn#39301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31602, offset: 0x010de798, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.hasRecentlyVisitedAndRead();
|
|
}, false);
|
|
}
|
|
|
|
function value_39303(a0) { // fn#39303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31717, offset: 0x010de7e2, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canBeUnread() ? a0.ackMessageId : null;
|
|
}, null);
|
|
}
|
|
|
|
function value_39305(a0) { // fn#39305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31850, offset: 0x010de837, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canTrackUnreads() ? a0._ackMessageId : null;
|
|
}, null);
|
|
}
|
|
|
|
function value_39307(a0) { // fn#39307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31979, offset: 0x010de88c, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.lastMessageId;
|
|
}, null);
|
|
}
|
|
|
|
function value_39309(a0) { // fn#39309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32090, offset: 0x010de8d2, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.lastMessageTimestamp;
|
|
}, 0);
|
|
}
|
|
|
|
function value_39311(a0) { // fn#39311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32201, offset: 0x010de918, size: 44 bytes, params: 2, frame: 17
|
|
const binding = env1_79;
|
|
const getValue = binding.getValue;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
return Reflect.apply(getValue, binding, [a0, CHANNEL, function(a0) {
|
|
return a0.lastPinTimestamp;
|
|
}, null]);
|
|
}
|
|
|
|
function value_39313(a0) { // fn#39313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32315, offset: 0x010de94f, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canTrackUnreads() ? a0.oldestUnreadMessageId : null;
|
|
}, null);
|
|
}
|
|
|
|
function value_39315(a0) { // fn#39315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32463, offset: 0x010de9a4, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.canTrackUnreads() ? a0.oldestUnreadTimestamp : 0;
|
|
}, 0);
|
|
}
|
|
|
|
function value_39317(a0) { // fn#39317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32592, offset: 0x010de9f9, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0.estimated;
|
|
}, false);
|
|
}
|
|
|
|
function value_39319(a0) { // fn#39319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32692, offset: 0x010dea3f, size: 59 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a1;
|
|
const r5 = value !== undefined ? value : ReadStateTypes.CHANNEL;
|
|
value = environment.__proto__;
|
|
return env1_79.getValue(a0, r5, function(a0) {
|
|
return a0._persisted;
|
|
}, false);
|
|
}
|
|
|
|
function value_39321(a0) { // fn#39321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32791, offset: 0x010dea85, size: 44 bytes, params: 2, frame: 17
|
|
const binding = env1_79;
|
|
const getValue = binding.getValue;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
return Reflect.apply(getValue, binding, [a0, CHANNEL, function(a0) {
|
|
return a0.canBeUnread() && a0.lastPinTimestamp > a0.ackPinTimestamp;
|
|
}, false]);
|
|
}
|
|
|
|
function value_39323(a0, a1, a2) { // fn#39323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:32930, offset: 0x010dead3, size: 157 bytes, params: 4, frame: 16
|
|
let value = environment.__proto__;
|
|
let binding = env1_79;
|
|
let get = binding.get;
|
|
const value2 = Reflect.apply(get, binding, [a1]);
|
|
binding = env1_79;
|
|
get = binding.get;
|
|
if (Reflect.apply(get, binding, [a0])._persisted === true) {
|
|
return false;
|
|
}
|
|
if (value2.ackMessageIdAtChannelSelect == null) {
|
|
return false;
|
|
}
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport.compare(a0, value2.ackMessageIdAtChannelSelect) <= 0) {
|
|
return false;
|
|
}
|
|
const guildJoinedAtTime = getGuildJoinedAtTime(a2);
|
|
value = defaultImport;
|
|
return value.extractTimestamp(a0) > guildJoinedAtTime;
|
|
}
|
|
|
|
function value_39324(a0) { // fn#39324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33191, offset: 0x010deb70, size: 41 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
env1_79.forEach(_fun39325);
|
|
return [];
|
|
}
|
|
|
|
function value_39326(a0) { // fn#39326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33618, offset: 0x010decbd, size: 29 bytes, params: 2, frame: 11
|
|
const binding = env1_79;
|
|
const getGuildSentinels = binding.getGuildSentinels;
|
|
return Reflect.apply(getGuildSentinels, binding, [a0]).unreadsSentinel;
|
|
}
|
|
|
|
function value_39327() { // fn#39327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33713, offset: 0x010decda, size: 19 bytes, params: 1, frame: 9
|
|
return env1_79.getMentionChannelIds();
|
|
}
|
|
|
|
function value_39328(a0) { // fn#39328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33791, offset: 0x010deced, size: 67 bytes, params: 2, frame: 14
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value3 = null;
|
|
const id = value3 == currentUser ? undefined : currentUser.id;
|
|
return value3 == id ? value3 : env1_79.get(id, a0).ackMessageId;
|
|
}
|
|
|
|
function value_39329(a0, a1) { // fn#39329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33924, offset: 0x010ded30, size: 92 bytes, params: 3, frame: 11
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
if (env1_79.get(a0).snapshot == null) {
|
|
value = value.takeSnapshot();
|
|
r0 = value;
|
|
} else if (global.Date.now() - value.snapshot.takenAt > a1) {
|
|
value = value.takeSnapshot();
|
|
r0 = value;
|
|
} else {
|
|
r0 = value.snapshot;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_39330(a0) { // fn#39330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:34079, offset: 0x010ded8c, size: 25 bytes, params: 2, frame: 11
|
|
return env1_73.getAllChannelIdsForWindowId(a0);
|
|
}
|
|
|
|
function _fun39333(a0) { // fn#39333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:34822, offset: 0x010df0a2, size: 496 bytes, params: 2, frame: 19
|
|
var defaultImport;
|
|
var defaultImport2;
|
|
let value = a0;
|
|
const r5 = value.read_state_type ?? ReadStateTypes.CHANNEL;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
const r3 = r5 === CHANNEL ? value : {id: value.id, read_state_type: value.read_state_type,
|
|
mention_count: value.badge_count, last_message_id: value.last_acked_id};
|
|
value = env1_79.get(r3.id, r5);
|
|
value._persisted = true;
|
|
const mention_count = r3.mention_count;
|
|
const value4 = 0;
|
|
value._mentionCount = mention_count ?? value4;
|
|
value.flags = r3.flags;
|
|
value.lastViewed = r3.last_viewed;
|
|
const basicChannel = ChannelStore.getBasicChannel(r3.id);
|
|
if (basicChannel == null) {
|
|
if (value.ackedWhileCached) {
|
|
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport2.compare(value.ackMessageId, r3.last_message_id) === -1) {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
} else {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
} else if (isThread(basicChannel.type)) {
|
|
if (r3.last_message_id == null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value.ackMessageId = defaultImport.fromTimestamp(getThreadAckMessageTimestamp(basicChannel.guild_id,
|
|
basicChannel.id));
|
|
} else if (value4 !== r3.last_message_id) {
|
|
if (value.ackedWhileCached) {
|
|
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport2.compare(value.ackMessageId, r3.last_message_id) === -1) {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
} else {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
} else {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value.ackMessageId = defaultImport.fromTimestamp(getThreadAckMessageTimestamp(basicChannel.guild_id,
|
|
basicChannel.id));
|
|
}
|
|
} else if (value.ackedWhileCached) {
|
|
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport2.compare(value.ackMessageId, r3.last_message_id) === -1) {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
} else {
|
|
value.ackMessageId = r3.last_message_id;
|
|
}
|
|
value.ackedWhileCached = undefined;
|
|
value.ackPinTimestamp = parseTimestamp(r3.last_pin_timestamp);
|
|
let _mentionChannels = env1_79._mentionChannels;
|
|
_mentionChannels.delete(value.channelId);
|
|
if (value._mentionCount > value4 && value.canHaveMentions()) {
|
|
_mentionChannels = env1_79._mentionChannels;
|
|
_mentionChannels.add(value.channelId);
|
|
}
|
|
}
|
|
|
|
function _fun39334() { // fn#39334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:36219, offset: 0x010df292, size: 134 bytes, params: 1, frame: 19
|
|
var r2;
|
|
var r9;
|
|
var value5;
|
|
var read_state_type;
|
|
var CHANNEL;
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value6;
|
|
var shouldDeleteReadState;
|
|
var value7;
|
|
const entries = readState.entries;
|
|
const value2 = generateOldThreadCutoff();
|
|
const value3 = _createForOfIteratorHelperLoose_39151(entries);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
read_state_type = value5.read_state_type;
|
|
if (read_state_type != null) {
|
|
r9 = read_state_type;
|
|
} else {
|
|
CHANNEL = ReadStateTypes.CHANNEL;
|
|
r9 = CHANNEL;
|
|
}
|
|
binding = env1_79;
|
|
get = binding.get;
|
|
id = value5.id;
|
|
value6 = Reflect.apply(get, binding, [id, r9]);
|
|
shouldDeleteReadState = value6.shouldDeleteReadState;
|
|
if (!Reflect.apply(shouldDeleteReadState, value6, [value2])) {
|
|
continue;
|
|
}
|
|
env1_80(value6);
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39337(a0) { // fn#39337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:36838, offset: 0x010df38f, size: 71 bytes, params: 2, frame: 13
|
|
const value2 = env1_79.get(a0.channelId);
|
|
value2.deserializeForOverlay(a0);
|
|
const type = value2.type;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type === CHANNEL) {
|
|
value2.rebuildChannelState();
|
|
}
|
|
}
|
|
|
|
function _fun39339(a0) { // fn#39339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:37044, offset: 0x010df405, size: 194 bytes, params: 2, frame: 19
|
|
var r32;
|
|
var map;
|
|
const r3 = a0.type ?? ReadStateTypes.CHANNEL;
|
|
a0.type = r3;
|
|
let _readStates = env1_79._readStates;
|
|
const value2 = _readStates.get(r3);
|
|
if (value2 != null) {
|
|
r32 = value2;
|
|
} else {
|
|
map = new global.Map();
|
|
}
|
|
const set = r32.set;
|
|
const channelId = a0.channelId;
|
|
const typeUtilsModule = require(1392) /* metro dependency 1392: TypeUtils */;
|
|
Reflect.apply(set, r32, [channelId, typeUtilsModule.dangerouslyCast(a0, env1_79)]);
|
|
_readStates = env1_79._readStates;
|
|
if (!_readStates.has(r3)) {
|
|
env1_79._readStates.set(r3, r32);
|
|
}
|
|
}
|
|
|
|
function _fun39341(a0) { // fn#39341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:37342, offset: 0x010df557, size: 61 bytes, params: 2, frame: 12
|
|
if (a0.guildId === guild.id && a0.shouldDeleteReadState(env0_1)) {
|
|
a0.delete(false);
|
|
}
|
|
}
|
|
|
|
function _fun39357(a0) { // fn#39357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:44226, offset: 0x010e02ec, size: 222 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var get;
|
|
var id;
|
|
var value2;
|
|
var hasJoined;
|
|
var value3;
|
|
let value = environment.__proto__;
|
|
if (ALL_CHANNEL_TYPES.has(a0.type)) {
|
|
binding = env1_79;
|
|
get = binding.get;
|
|
id = a0.id;
|
|
value2 = Reflect.apply(get, binding, [id]);
|
|
value2.lastMessageId = a0.lastMessageId;
|
|
value2.lastPinTimestamp = parseTimestamp(a0.lastPinTimestamp);
|
|
value2._isThread = true;
|
|
value2._isActiveThread = true;
|
|
hasJoined = JoinedThreadsStore.hasJoined;
|
|
id = a0.id;
|
|
value2._isJoinedThread = Reflect.apply(hasJoined, JoinedThreadsStore, [id]);
|
|
if (a0.isForumPost()) {
|
|
binding = env1_79;
|
|
value3 = binding.get(a0.parent_id);
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value = value.compare(value3.lastMessageId, a0.id);
|
|
if (value < 0) {
|
|
value3.lastMessageId = a0.id;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39361(a0, a1) { // fn#39361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:45169, offset: 0x010e0464, size: 171 bytes, params: 3, frame: 16
|
|
var r0;
|
|
var value3;
|
|
var value4;
|
|
if (a1.has(env0_0.windowId)) {
|
|
if (a0 == null) {
|
|
r0 = false;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
value4 = env1_79.get(a0);
|
|
if (!(env0_0.focused || value4.hasUnread())) {
|
|
value4.oldestUnreadMessageIdStale = true;
|
|
}
|
|
r0 = tryAck({section: AnalyticsSections.CHANNEL, object: AnalyticsObjects.ACK_WINDOW_FOCUS,
|
|
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC}, a0);
|
|
}
|
|
if (r0) {
|
|
}
|
|
}
|
|
}
|
|
|
|
function _handleBulkAck(a0, a1, a2) { // fn#39365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:45750, owner: BULK_ACK._handleBulkAck, offset: 0x010e05a0, size: 109 bytes, params: 4, frame: 16
|
|
var binding;
|
|
var push;
|
|
var value2;
|
|
var items2;
|
|
a0.forEach(_fun39366);
|
|
if (a1 === CURRENT_APP_CONTEXT) {
|
|
binding = env1_70;
|
|
push = binding.push;
|
|
value2 = a0.map(function(a0) {
|
|
return {channel_id: a0.channelId, message_id: a0.messageId, read_state_type: a0.readStateType};
|
|
});
|
|
items2 = [];
|
|
arraySpread(items2, value2, 0, a0);
|
|
apply(push, items2, binding, a0);
|
|
if (!env1_71) {
|
|
processBulkAckQueue(a2);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39368(a0) { // fn#39368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:46106, offset: 0x010e0686, size: 49 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var binding;
|
|
let value = a0.messageId != null;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
binding = env1_81;
|
|
value = binding.hasUnreadOrMentions(a0.channelId, a0.readStateType);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun39382(a0) { // fn#39382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:49447, offset: 0x010e0d34, size: 107 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var Math;
|
|
let value = environment.__proto__;
|
|
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare, value,
|
|
[env0_0.ackMessageId, a0]);
|
|
if (value < 0) {
|
|
binding = env0_0;
|
|
Math = global.Math;
|
|
binding.mentionCount = Math.max(env0_0.mentionCount - 1, 0);
|
|
}
|
|
}
|
|
|
|
function _fun39164() { // fn#39164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:5052, offset: 0x010da1a7, size: 92 bytes, params: 1, frame: 13
|
|
const HTTP = env3_0(env3_2[47]).HTTP;
|
|
const post = HTTP.post;
|
|
const BULK_ACK = env3_44.BULK_ACK;
|
|
return Reflect.apply(post, HTTP, [{url: BULK_ACK, body: {read_states: env0_0}, oldFormErrors: true,
|
|
rejectWithError: false}]);
|
|
}
|
|
|
|
function _fun39174(a0) { // fn#39174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:24278, offset: 0x010da809, size: 238 bytes, params: 2, frame: 19
|
|
var binding;
|
|
var value2;
|
|
var defaultImport;
|
|
if (ALL_CHANNEL_TYPES.has(a0.type)) {
|
|
binding = env2_79;
|
|
value2 = binding.get(a0.id);
|
|
value2.lastMessageId = a0.lastMessageId;
|
|
value2.lastPinTimestamp = parseTimestamp(a0.lastPinTimestamp);
|
|
value2._isThread = true;
|
|
value2._isActiveThread = true;
|
|
value2._isJoinedThread = a0.member != null;
|
|
if (value2.ackMessageId == null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
value2.ackMessageId = defaultImport.fromTimestamp(getThreadAckMessageTimestamp(env0_0.id, a0.id));
|
|
}
|
|
if (value2.ackPinTimestamp == null) {
|
|
value2.ackPinTimestamp = getThreadAckMessageTimestamp(env0_0.id, a0.id);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39176(a0) { // fn#39176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:24990, offset: 0x010da9db, size: 122 bytes, params: 2, frame: 18
|
|
var binding;
|
|
let value = environment.__proto__.__proto__;
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
const compare = defaultImport.compare;
|
|
let id = a0.id;
|
|
if (Reflect.apply(compare, defaultImport, [id, env0_1]) > 0) {
|
|
id = a0.id;
|
|
}
|
|
value = defaultImport;
|
|
if (value.compare(a0.id, env0_2) > 0) {
|
|
binding = env0_0;
|
|
env0_0 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
}
|
|
}
|
|
|
|
function _fun39179(a0) { // fn#39179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:25651, offset: 0x010daabc, size: 222 bytes, params: 2, frame: 15
|
|
var r2;
|
|
var type;
|
|
var value;
|
|
var Date;
|
|
var value2;
|
|
var date;
|
|
var time;
|
|
var defaultImport;
|
|
var binding;
|
|
var mentionCount;
|
|
let since = a0.since;
|
|
if (since != null) {
|
|
type = a0.type;
|
|
value = environment.__proto__.__proto__;
|
|
if (type === RelationshipTypes.PENDING_INCOMING) {
|
|
Date = global.Date;
|
|
since = a0.since;
|
|
value2 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date(since);
|
|
time = (date instanceof Object ? date : value2).getTime();
|
|
if (env0_0.ackMessageId != null) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
r2 = defaultImport.extractTimestamp(env0_0.ackMessageId);
|
|
} else {
|
|
r2 = 0;
|
|
}
|
|
if (r2 < time) {
|
|
binding = env0_0;
|
|
mentionCount = binding.mentionCount;
|
|
binding.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
binding = env0_0;
|
|
binding.lastMessageId = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).fromTimestamp(time);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39192(a0) { // fn#39192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:28272, offset: 0x010db1c3, size: 72 bytes, params: 2, frame: 14
|
|
const mergeServerChannelsBinding = mergeServerChannels;
|
|
const value2 = a0.map(function(a0) {
|
|
return a0.thread;
|
|
});
|
|
mergeServerChannelsBinding(value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish));
|
|
}
|
|
|
|
function _fun39232(a0) { // fn#39232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:11871, offset: 0x010dc4a1, size: 91 bytes, params: 2, frame: 6
|
|
var id;
|
|
var id2;
|
|
let mentionCountBinding = mentionCount;
|
|
if (mentionCountBinding > 0) {
|
|
id2 = a0.author.id;
|
|
id = env0_2?.id;
|
|
if (id2 !== id) {
|
|
mentionCountBinding = mentionCount;
|
|
env0_1 = typeof mentionCountBinding === 'bigint' ? mentionCountBinding - 1n : +mentionCountBinding - 1;
|
|
return undefined;
|
|
}
|
|
if (mentionCount !== 0) {
|
|
return undefined;
|
|
}
|
|
id = a0.id;
|
|
} else {
|
|
if (mentionCount !== 0) {
|
|
return undefined;
|
|
}
|
|
id = a0.id;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function _fun39236(a0) { // fn#39236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:12658, offset: 0x010dc6c4, size: 211 bytes, params: 2, frame: 16
|
|
var r1;
|
|
var binding;
|
|
var unreadCount;
|
|
var mentionCount;
|
|
if (env0_4) {
|
|
binding = env0_0;
|
|
binding.oldestUnreadMessageId = binding._oldestUnreadMessageId ?? a0.id;
|
|
} else {
|
|
result = a0.id === env0_0._ackMessageId;
|
|
}
|
|
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
if (defaultImport.extractTimestamp(a0.id) > env0_3) {
|
|
binding = env0_0;
|
|
unreadCount = binding.unreadCount;
|
|
binding.unreadCount = typeof unreadCount === 'bigint' ? unreadCount + 1n : +unreadCount + 1;
|
|
binding = env0_1;
|
|
if (binding && shouldBadgeMessage(a0, env0_2)) {
|
|
binding = env0_0;
|
|
mentionCount = binding.mentionCount;
|
|
binding.mentionCount = typeof mentionCount === 'bigint' ? mentionCount + 1n : +mentionCount + 1;
|
|
}
|
|
r1 = env0_6 ?? a0.id;
|
|
}
|
|
}
|
|
|
|
function _fun39238(a0) { // fn#39238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:13341, offset: 0x010dc858, size: 134 bytes, params: 2, frame: 18
|
|
var defaultImport;
|
|
var compare;
|
|
var id;
|
|
var binding;
|
|
let value = environment.__proto__.__proto__;
|
|
if (isEventUpcoming(a0)) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
compare = defaultImport.compare;
|
|
id = a0.id;
|
|
if (Reflect.apply(compare, defaultImport, [id, env0_1]) > 0) {
|
|
id = a0.id;
|
|
}
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
compare = value.compare;
|
|
id = a0.id;
|
|
if (Reflect.apply(compare, value, [id, env0_0]) > 0) {
|
|
binding = env0_2;
|
|
env0_2 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39250() { // fn#39250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:16220, offset: 0x010dce4e, size: 86 bytes, params: 1, frame: 14
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const PINS_ACK = Endpoints.PINS_ACK;
|
|
return Reflect.apply(post, HTTP, [{'url': null, 'oldFormErrors': true, 'rejectWithError': true,
|
|
url: Reflect.apply(PINS_ACK, Endpoints, [env0_0.channelId])}]);
|
|
}
|
|
|
|
function _fun39252() { // fn#39252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:17032, offset: 0x010dcfed, size: 95 bytes, params: 1, frame: 14
|
|
var binding;
|
|
const type = env0_0.type;
|
|
const CHANNEL = ReadStateTypes.CHANNEL;
|
|
if (type === CHANNEL) {
|
|
binding = env0_0;
|
|
binding._ack(location, trackAnalytics);
|
|
} else {
|
|
env0_0._nonChannelAck();
|
|
}
|
|
binding = env0_0;
|
|
binding.outgoingAck = null;
|
|
binding.outgoingAckTimer = null;
|
|
}
|
|
|
|
function _fun39257() { // fn#39257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:17975, offset: 0x010dd23d, size: 126 bytes, params: 1, frame: 19
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const MESSAGE_ACK = Endpoints.MESSAGE_ACK;
|
|
const binding = env0_0;
|
|
return Reflect.apply(post, HTTP, [{url: Reflect.apply(MESSAGE_ACK, Endpoints, [binding.channelId, outgoingAck]),
|
|
body: {token: env2_68, last_viewed: binding.lastViewed, flags: env0_6}, oldFormErrors: true,
|
|
rejectWithError: true}]);
|
|
}
|
|
|
|
function _fun39258(a0) { // fn#39258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18134, offset: 0x010dd2bb, size: 183 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var value;
|
|
var token;
|
|
if (a0 != null) {
|
|
value = environment.__proto__.__proto__;
|
|
if (env2_68 === env0_5 && env0_4 === AuthenticationStore.getId()) {
|
|
token = a0.body.token;
|
|
}
|
|
importDefault(dependencyMap[44]).dispatch({type: 'MESSAGE_ACKED'});
|
|
if (require) {
|
|
value = require(dependencyMap[56]);
|
|
value = value(dependencyMap[55], dependencyMap.paths);
|
|
value.then(_fun39259);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun39262() { // fn#39262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18871, offset: 0x010dd4cd, size: 73 bytes, params: 1, frame: 13
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
return HTTP.post({url: env0_0, body: {}, oldFormErrors: true, rejectWithError: true});
|
|
}
|
|
|
|
function _fun39300(a0) { // fn#39300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:31463, offset: 0x010de76f, size: 41 bytes, params: 2, frame: 19
|
|
return a0.getGuildChannelUnreadState(env0_0, require, importDefault, importAll, env0_4);
|
|
}
|
|
|
|
function _fun39325(a0) { // fn#39325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:33231, offset: 0x010deb99, size: 292 bytes, params: 2, frame: 15
|
|
var binding;
|
|
var value2;
|
|
var defaultImport;
|
|
var cast;
|
|
const type = a0.type;
|
|
let value = environment.__proto__.__proto__;
|
|
const GUILD_HOME = ReadStateTypes.GUILD_HOME;
|
|
if (GUILD_HOME === type) {
|
|
if (GuildStore.getGuild(a0.channelId) != null) {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
} else if (ReadStateTypes.GUILD_EVENT === type) {
|
|
if (GuildStore.getGuild(a0.channelId) != null) {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
} else if (ReadStateTypes.GUILD_ONBOARDING_QUESTION === type) {
|
|
if (GuildStore.getGuild(a0.channelId) != null) {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
} else if (ReadStateTypes.NOTIFICATION_CENTER === type) {
|
|
value2 = undefined;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
cast = defaultImport.cast;
|
|
value = UserStore.getCurrentUser();
|
|
value = Reflect.apply(cast, defaultImport, [value == null ? value2 : value.id]);
|
|
if (value === a0.channelId) {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
} else if (ReadStateTypes.MESSAGE_REQUESTS === type) {
|
|
value2 = undefined;
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
cast = defaultImport.cast;
|
|
value = UserStore.getCurrentUser();
|
|
value = Reflect.apply(cast, defaultImport, [value == null ? value2 : value.id]);
|
|
if (value === a0.channelId) {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
} else {
|
|
binding = env0_1;
|
|
binding.push(a0.serialize(env0_0));
|
|
}
|
|
}
|
|
|
|
function _fun39366({channelId, messageId, readStateType}) { // fn#39366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:45792, offset: 0x010e060d, size: 84 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
env2_79.get(channelId, readStateType).ack({'messageId': null, 'local': true, 'immediate': null, 'force': null,
|
|
'isExplicitUserAction': true, 'trackAnalytics': false, messageId: messageId, immediate: undefined,
|
|
force: undefined});
|
|
}
|
|
|
|
function _fun39259({default: property}) { // fn#39259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4783:18265, offset: 0x010dd372, size: 48 bytes, params: 2, frame: 14
|
|
property(env1_0.channelId, env1_1 ?? ({}));
|
|
}
|
|
|