170 lines
9.4 KiB
TypeScript
170 lines
9.4 KiB
TypeScript
/* Metro module 11171; source: modules/messages/markUnread.tsx; dependencies: [5, 3786, 1379, 4814, 4605, 1878, 661, 3, 21, 7153, 507, 2] */
|
|
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import JoinedThreadsStore from '../threads/JoinedThreadsStore.tsx'; /* Metro dependency 3786 */
|
|
import MessageStore from '../../stores/MessageStore.tsx'; /* Metro dependency 4814 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ReadStateStoreModule from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
|
|
|
|
function _fun85310(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:6, offset: 0x01f6ac4b, size: 279 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Logger;
|
|
value = new value('markUnread');
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/messages/markUnread.tsx');
|
|
exports.default = function() {
|
|
return _markUnread.apply(this, arguments);
|
|
};
|
|
function _markUnread() { // fn#85311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:225, offset: 0x01f6ad62, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85313).apply(this, arguments);
|
|
function* _fun85313(a0, a1) { // fn#85313, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:270, offset: 0x01f6ad9f, size: 505 bytes, params: 3, frame: 22
|
|
var environment;
|
|
var r9;
|
|
var value13;
|
|
var value16;
|
|
var object;
|
|
var HTTP;
|
|
var post;
|
|
if (true) {
|
|
var env0_0 = a1;
|
|
var env0_3;
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_8;
|
|
if (binding.getCurrentUser() != null) {
|
|
binding = env2_6;
|
|
var messages = binding.getMessages(a0);
|
|
var property = messages.toArray().filter(_fun85314).sort(_fun85315).reverse()[0];
|
|
r9 = property == null ? env2_1(env2_2[8]).atPreviousMillisecond(a1) : property.id;
|
|
env0_3 = 0;
|
|
messages.forAll(_fun85316);
|
|
binding = env2_5;
|
|
var channel = binding.getChannel(a0);
|
|
if (channel != null && channel.isThread()) {
|
|
if (channel.isArchivedThread()) {
|
|
binding = env2_1;
|
|
value13 = binding(env2_2[9]);
|
|
yield value13.unarchiveThread(channel, false);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_4;
|
|
if (binding.hasJoined(a0)) {
|
|
binding = env2_10;
|
|
binding.log('Marking unread', {channelId: a0, messageId: a1});
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[10]).HTTP;
|
|
post = HTTP.post;
|
|
object = {};
|
|
binding = env2_9;
|
|
object.url = binding.MESSAGE_ACK(a0, r9);
|
|
object.body = {manual: true, mention_count: env0_3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = true;
|
|
Reflect.apply(post, HTTP, [object]);
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
value16 = binding(env2_2[9]);
|
|
yield value16.joinThread(channel, 'Mark Unread');
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_10;
|
|
binding.log('Marking unread', {channelId: a0, messageId: a1});
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[10]).HTTP;
|
|
post = HTTP.post;
|
|
object = {};
|
|
binding = env2_9;
|
|
object.url = binding.MESSAGE_ACK(a0, r9);
|
|
object.body = {manual: true, mention_count: env0_3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = true;
|
|
Reflect.apply(post, HTTP, [object]);
|
|
return undefined;
|
|
}
|
|
binding = env2_4;
|
|
if (binding.hasJoined(a0)) {
|
|
binding = env2_10;
|
|
binding.log('Marking unread', {channelId: a0, messageId: a1});
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[10]).HTTP;
|
|
post = HTTP.post;
|
|
object = {};
|
|
binding = env2_9;
|
|
object.url = binding.MESSAGE_ACK(a0, r9);
|
|
object.body = {manual: true, mention_count: env0_3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = true;
|
|
Reflect.apply(post, HTTP, [object]);
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
value16 = binding(env2_2[9]);
|
|
yield value16.joinThread(channel, 'Mark Unread');
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_10;
|
|
binding.log('Marking unread', {channelId: a0, messageId: a1});
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[10]).HTTP;
|
|
post = HTTP.post;
|
|
object = {};
|
|
binding = env2_9;
|
|
object.url = binding.MESSAGE_ACK(a0, r9);
|
|
object.body = {manual: true, mention_count: env0_3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = true;
|
|
Reflect.apply(post, HTTP, [object]);
|
|
return undefined;
|
|
}
|
|
binding = env2_10;
|
|
binding.log('Marking unread', {channelId: a0, messageId: a1});
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[10]).HTTP;
|
|
post = HTTP.post;
|
|
object = {};
|
|
binding = env2_9;
|
|
object.url = binding.MESSAGE_ACK(a0, r9);
|
|
object.body = {manual: true, mention_count: env0_3};
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = true;
|
|
Reflect.apply(post, HTTP, [object]);
|
|
}
|
|
}
|
|
function _fun85314({id}) { // fn#85314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:367, offset: 0x01f6af98, size: 60 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
value = env3_1(env3_2[8]);
|
|
value = value.compare(id, require);
|
|
return value < 0;
|
|
}
|
|
|
|
function _fun85315({id}, {id}) { // fn#85315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:404, offset: 0x01f6afd4, size: 55 bytes, params: 3, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return env3_1(env3_2[8]).compare(id, id);
|
|
}
|
|
|
|
function _fun85316(a0) { // fn#85316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11357:515, offset: 0x01f6b00b, size: 91 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
let binding = env3_1;
|
|
const value2 = binding(env3_2[8]);
|
|
if (value2.compare(a0.id, env0_2) > 0 && env3_7(a0, env0_1)) {
|
|
binding = env0_3;
|
|
env0_3 = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun85310, 11171, [5, 3786, 1379, 4814, 4605, 1878, 661, 3, 21, 7153, 507,
|
|
2]) /* metro module 11171, dependencies: [5, 3786, 1379, 4814, 4605, 1878, 661, 3, 21, 7153, 507, 2] */;
|