64 lines
2.4 KiB
TypeScript
64 lines
2.4 KiB
TypeScript
// Module ID: 8739
|
|
// Function ID: 8740
|
|
// Name: InviteQueue
|
|
// Dependencies: [2063, 1102, 7727, 3, 7167, 7001, 2]
|
|
|
|
// Module 8739 (InviteQueue)
|
|
import LoggerDefault from "Logger" /* 3 */;
|
|
import DurationsDefault from "Durations" /* 1102 */;
|
|
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7167 */;
|
|
import ChannelStore from "ChannelStore" /* 2063 */;
|
|
import Queue from "Queue" /* 7727 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let dependencyMap;
|
|
|
|
let sum = DurationsDefault.Millis.SECOND + 10;
|
|
let c3 = sum;
|
|
const InvitePropertiesType = { GROUP_DM: 0, [0]: "GROUP_DM", USER: 1, [1]: "USER", CHANNEL: 2, [2]: "CHANNEL" };
|
|
class InviteQueue extends Queue {
|
|
constructor() {
|
|
const tmp2 = LoggerDefault;
|
|
const tmp22 = new tmp2("InviteQueue");
|
|
const tmp3 = new tmp(tmp22, c3, tmp2);
|
|
return tmp3;
|
|
}
|
|
_sendInvite(channel, inviteKey, _location, inviteAnalyticsMetadata, sum) {
|
|
let closure_0 = sum;
|
|
const obj = MessageActionCreatorsDefault;
|
|
const sendInviteResult = obj.sendInvite(channel.id, inviteKey, _location, inviteAnalyticsMetadata);
|
|
sendInviteResult.then(() => closure_0(null, true), () => closure_0(null, false));
|
|
}
|
|
}
|
|
const prototype = InviteQueue.prototype;
|
|
function drain(location, sum) {
|
|
const self = this;
|
|
dependencyMap = location;
|
|
const _location = location.location;
|
|
const inviteAnalyticsMetadata = location.inviteAnalyticsMetadata;
|
|
const type = location.type;
|
|
if (self.GROUP_DM !== type) {
|
|
if (self.CHANNEL !== type) {
|
|
if (self.USER === type) {
|
|
const obj = inviteAnalyticsMetadata(7001);
|
|
const ensurePrivateChannelResult = obj.ensurePrivateChannel(location.user.id);
|
|
ensurePrivateChannelResult.then((result) => {
|
|
const channel = ChannelStore.getChannel(result);
|
|
if (null != channel) {
|
|
self._sendInvite(channel, _location.inviteKey, _location, inviteAnalyticsMetadata, sum);
|
|
} else {
|
|
sum(null, false);
|
|
}
|
|
}, () => sum(null, false));
|
|
}
|
|
}
|
|
}
|
|
self._sendInvite(location.channel, location.inviteKey, _location, inviteAnalyticsMetadata, sum);
|
|
}
|
|
prototype["drain"] = drain;
|
|
const tmp5 = new LoggerDefault("InviteQueue");
|
|
const drain1 = new drain(tmp5, sum, tmp, prototype, this, InviteQueue, drain, dependencyMap, this);
|
|
const result = size.fileFinishedImporting("lib/InviteQueue.tsx");
|
|
|
|
export default drain1;
|
|
export { InvitePropertiesType };
|