Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
144 lines
4.9 KiB
TypeScript
144 lines
4.9 KiB
TypeScript
// Module ID: 9903
|
|
// Function ID: 9904
|
|
// Name: markUnread
|
|
// Dependencies: [5, 4500, 2044, 5065, 4860, 1372, 1074, 3, 11, 7357, 1271, 2]
|
|
// Exports: default
|
|
|
|
// Module 9903 (markUnread)
|
|
import LoggerDefault from "Logger" /* 3 */;
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
|
import ThreadActionCreatorsDefault from "ThreadActionCreators" /* 7357 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import JoinedThreadsStore from "JoinedThreadsStore" /* 4500 */;
|
|
import ChannelStore from "ChannelStore" /* 2044 */;
|
|
import MessageStore from "MessageStore" /* 5065 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
const require = fn;
|
|
let closure_11 = async function _markUnread(arg0, value) {
|
|
if (c5 === 2) {
|
|
c5 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp4 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj2 = { value, done: true };
|
|
return obj2;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c5 = 2;
|
|
if (0 === c4) {
|
|
if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj4 = { value, done: true };
|
|
return obj4;
|
|
} else {
|
|
closure_3 = tmp5;
|
|
dependencyMap = tmp2;
|
|
closure_130_0 = closure_0;
|
|
closure_130_1 = closure_1;
|
|
closure_130_2 = undefined;
|
|
closure_130_3 = undefined;
|
|
closure_130_4 = undefined;
|
|
closure_130_5 = undefined;
|
|
currentUser = currentUser.getCurrentUser();
|
|
closure_130_2 = currentUser;
|
|
if (null != currentUser) {
|
|
messages = messages.getMessages(tmp40);
|
|
const found = messages.toArray().filter((id) => closure_1(11).compare(id.id, closure_1_1) < 0);
|
|
const sorted = found.sort((id, id2) => closure_1_1(11).compare(id.id, id2.id));
|
|
const first = sorted.reverse()[0];
|
|
if (null == first) {
|
|
let id = SnowflakeUtilsDefault.atPreviousMillisecond(closure_1);
|
|
} else {
|
|
id = first.id;
|
|
}
|
|
closure_130_3 = id;
|
|
closure_130_4 = 0;
|
|
messages.forAll((id) => {
|
|
let tmp = closure_1(11).compare(id.id, closure_1_3) > 0;
|
|
if (tmp) {
|
|
tmp = closure_2_7(id, dependencyMap);
|
|
}
|
|
if (tmp) {
|
|
closure_4 = closure_4 + 1;
|
|
}
|
|
});
|
|
channel = channel.getChannel(tmp40);
|
|
closure_130_5 = channel;
|
|
let isThreadResult = null != channel;
|
|
if (isThreadResult) {
|
|
isThreadResult = channel.isThread();
|
|
}
|
|
if (isThreadResult) {
|
|
if (channel.isArchivedThread()) {
|
|
c4 = 1;
|
|
c5 = 1;
|
|
const obj6 = { value: ThreadActionCreatorsDefault.unarchiveThread(channel, false), done: false };
|
|
return obj6;
|
|
}
|
|
}
|
|
const obj7 = { channelId: closure_130_0, messageId: closure_130_1 };
|
|
closure_131_10.log("Marking unread", obj7);
|
|
const HTTP = closure_131_0(closure_131_2[10]).HTTP;
|
|
const request = { url: closure_131_9.MESSAGE_ACK(closure_130_0, closure_130_3), body: null, oldFormErrors: true, rejectWithError: true };
|
|
const obj8 = { manual: true, mention_count: closure_130_4 };
|
|
request.body = obj8;
|
|
HTTP.post(request);
|
|
const toArrayResult = messages.toArray();
|
|
}
|
|
c5 = 3;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else if (1 === tmp5) {
|
|
if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj9 = { value, done: true };
|
|
return obj9;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
}
|
|
if (!closure_131_4.hasJoined(closure_130_0)) {
|
|
c4 = 2;
|
|
c5 = 1;
|
|
const obj11 = { value: closure_131_1(closure_131_2[9]).joinThread(closure_130_5, "Mark Unread"), done: false };
|
|
return obj11;
|
|
}
|
|
} catch (tmp35) {
|
|
c5 = tmp;
|
|
throw tmp35;
|
|
}
|
|
}
|
|
};
|
|
const shouldBadgeMessage = fn(4860).shouldBadgeMessage;
|
|
const Endpoints = fn(1074).Endpoints;
|
|
let closure_10 = new LoggerDefault("markUnread");
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/messages/markUnread.tsx");
|
|
|
|
export default function markUnread() {
|
|
const self = this;
|
|
const apply = closure_11.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|