Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
110 lines
4.2 KiB
TypeScript
110 lines
4.2 KiB
TypeScript
// Module ID: 10008
|
|
// Function ID: 10009
|
|
// Name: CallActionCreators
|
|
// Dependencies: [2045, 4409, 1376, 1078, 5630, 1275, 1245, 5110, 1119, 10009, 9972, 577, 2]
|
|
|
|
// Module 10008 (CallActionCreators)
|
|
import DispatcherDefault from "Dispatcher" /* 577 */;
|
|
import util from "util" /* 1119 */;
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1245 */;
|
|
import HTTPUtils from "HTTPUtils" /* 1275 */;
|
|
import AlertActionCreatorsDefault from "AlertActionCreators" /* 5110 */;
|
|
import SelectedChannelActionCreatorsDefault from "SelectedChannelActionCreators" /* 5630 */;
|
|
import useCanRing from "useCanRing" /* 9972 */;
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4409 */;
|
|
import UserStore from "UserStore" /* 1376 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
const Constants = fn(1078);
|
|
({ Endpoints: metroRequire, AnalyticEvents: closure_7, ChannelTypesSets: closure_8, ChannelTypes: closure_9 } = Constants);
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("actions/CallActionCreators.tsx");
|
|
|
|
export default {
|
|
call(id, MediaEngineStore, arg2, arg3, fn) {
|
|
const self = this;
|
|
importDefault = id;
|
|
dependencyMap = MediaEngineStore;
|
|
closure_3 = arg2;
|
|
RelationshipStore = arg3;
|
|
UserStore = fn;
|
|
if (null != arg3) {
|
|
if (!RelationshipStore.isBlocked(arg3)) {
|
|
_require = UserStore.getUser(arg3);
|
|
const HTTP = require("HTTPUtils").HTTP;
|
|
const obj2 = { url: self.CALL(id), oldFormErrors: true, rejectWithError: true };
|
|
value = HTTP.get(obj2);
|
|
value.then((body) => {
|
|
let ringable = closure_3;
|
|
if (closure_3) {
|
|
ringable = body.body.ringable;
|
|
}
|
|
const voiceChannel = SelectedChannelActionCreatorsDefault.selectVoiceChannel(closure_1, closure_2);
|
|
if (ringable) {
|
|
self.ring(tmp2);
|
|
}
|
|
if (closure_5 != null) {
|
|
closure_5(tmp2);
|
|
}
|
|
}, () => {
|
|
AnalyticsUtilsDefault.track(constants.OPEN_POPOUT, { type: "Not Friend", source: "Call" });
|
|
const obj3 = { title: null, body: null, confirmText: null, cancelText: null, onConfirm: null };
|
|
const intl = util.intl;
|
|
obj3.title = intl.string(util.t.My50nf);
|
|
const intl2 = util.intl;
|
|
let str = "";
|
|
if (null != user) {
|
|
str = user.username;
|
|
}
|
|
obj3.body = intl2.format(util.t.IdKo2z, { username: str });
|
|
const intl3 = tmp3(1119).intl;
|
|
obj3.confirmText = intl3.string(util.t["PMsq/b"]);
|
|
const intl4 = tmp3(1119).intl;
|
|
obj3.cancelText = intl4.string(util.t.BddRzS);
|
|
obj3.onConfirm = function onConfirm() {
|
|
closure_1(closure_2[9]).addRelationship({ userId, context: { location: "Call" } });
|
|
};
|
|
AlertActionCreatorsDefault.show(obj3);
|
|
});
|
|
}
|
|
} else {
|
|
let voiceChannel = SelectedChannelActionCreatorsDefault.selectVoiceChannel(id, MediaEngineStore);
|
|
if (arg2) {
|
|
self.ring(id);
|
|
}
|
|
if (fn != null) {
|
|
fn(id);
|
|
}
|
|
}
|
|
},
|
|
ring(channelId, items, voice_panel_floating_cta) {
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
if (null != channel) {
|
|
const CALLABLE = constants2.CALLABLE;
|
|
const result = useCanRing.canRingUsersInChannel(channel);
|
|
if (result) {
|
|
const HTTP = tmp3(1275).HTTP;
|
|
const request = { url: timestampProducer.CALL_RING(channelId), body: null, oldFormErrors: true, rejectWithError: true };
|
|
const obj3 = { recipients: items, analytics_location: voice_panel_floating_cta };
|
|
request.body = obj3;
|
|
HTTP.post(request);
|
|
if (tmp14) {
|
|
const obj4 = { type: "GUILD_LOCAL_RING_START", ringing: items, guildId: channel.guild_id };
|
|
DispatcherDefault.dispatch(obj4);
|
|
}
|
|
} else if (tmp7) {
|
|
const obj5 = { type: "CALL_ENQUEUE_RING", channelId, recipients: items };
|
|
DispatcherDefault.dispatch(obj5);
|
|
}
|
|
tmp3 = require;
|
|
}
|
|
},
|
|
stopRinging(channelId, items) {
|
|
const HTTP = HTTPUtils.HTTP;
|
|
const request = { url: timestampProducer.CALL_STOP_RINGING(channelId), body: { recipients: items }, oldFormErrors: true, rejectWithError: true };
|
|
return HTTP.post(request);
|
|
}
|
|
};
|