84 lines
5.1 KiB
TypeScript
84 lines
5.1 KiB
TypeScript
/* Metro module 15652; source: modules/friend_invites/native/FriendInviteUtils.tsx; dependencies: [1379, 3793, 8879, 3857, 1244, 8096, 694, 8776, 2] */
|
|
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import ToastActionCreators from '../../toast/native/ToastActionCreators.tsx'; /* Metro dependency 3857 */
|
|
import InstantInviteActionCreators from '../../../actions/InstantInviteActionCreators.tsx'; /* Metro dependency 8879 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
|
|
function _fun119978(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15860:6, offset: 0x0251d000, size: 182 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/friend_invites/native/FriendInviteUtils.tsx');
|
|
exports.DEFAULT_EXPIRATION_DAYS = 7;
|
|
exports.DEFAULT_EXPIRATION_USES = 5;
|
|
exports.revokeAllFriendInvites = revokeAllFriendInvites;
|
|
exports.acceptFriendInvite = acceptFriendInvite;
|
|
function handleInviteAccepted() { // fn#119979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15860:116, offset: 0x0251d0b6, size: 47 bytes, params: 1, frame: 12
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(function() {
|
|
return importDefault(dependencyMap[7])();
|
|
});
|
|
}
|
|
|
|
function revokeAllFriendInvites() { // fn#119981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15860:344, offset: 0x0251d104, size: 56 bytes, params: 1, frame: 12
|
|
let value = InstantInviteActionCreators;
|
|
value = value.revokeFriendInvites();
|
|
value.then(function() {
|
|
var defaultImport = importDefault(dependencyMap[3]);
|
|
var object = {key: 'TOAST_FRIEND_INVITES_REVOKED'};
|
|
object.content = require(dependencyMap[4]).intl.string(require(dependencyMap[4]).t.jSHEOQ);
|
|
object.icon = importDefault(dependencyMap[5]);
|
|
defaultImport.open(object);
|
|
});
|
|
}
|
|
|
|
function acceptFriendInvite(a0, a1) { // fn#119983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15860:554, offset: 0x0251d1b7, size: 223 bytes, params: 3, frame: 16
|
|
var r4;
|
|
var relationshipStoreBinding;
|
|
const env0_0 = a0;
|
|
const channel = a0.channel;
|
|
const value = null;
|
|
if (value == channel) {
|
|
if (value == a0.guild) {
|
|
if (value != a0.inviter) {
|
|
relationshipStoreBinding = RelationshipStore;
|
|
r4 = relationshipStoreBinding.isFriend(a0.inviter.id) ? ChannelStore.getDMFromUserId(a0.inviter.id) : value;
|
|
if (value != r4) {
|
|
(importDefault(8879) /* metro dependency 8879: InstantInviteActionCreators */).transitionToInviteChannelSync(r4);
|
|
handleInviteAccepted();
|
|
} else {
|
|
(importDefault(8879) /* metro dependency 8879: InstantInviteActionCreators */).acceptInviteAndTransitionToInviteChannel({inviteKey: a0.code,
|
|
|
|
|
|
|
|
|
|
context: a1, callback: callback_119984});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function acceptFriendInviteCallback() { // fn#119984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15860:867, owner: acceptFriendInvite.callback, offset: 0x0251d296, size: 177 bytes, params: 1, frame: 21
|
|
const value2 = undefined;
|
|
const defaultImport = ToastActionCreators;
|
|
const open = defaultImport.open;
|
|
const object = {key: 'FRIEND_INVITE_ACCEPT_CONFIRMATION'};
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const st2dcs = (IndexNativeModule).t.st2dcs;
|
|
const inviter = env0_0.inviter;
|
|
const username = inviter == null ? value2 : inviter.username;
|
|
object.content = Reflect.apply(formatToPlainString, intl, [st2dcs, {username: username}]);
|
|
object.icon = importDefault(8096) /* metro dependency 8096 */;
|
|
Reflect.apply(open, defaultImport, [object]);
|
|
handleInviteAccepted();
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun119978, 15652, [1379, 3793, 8879, 3857, 1244, 8096, 694, 8776,
|
|
2]) /* metro module 15652, dependencies: [1379, 3793, 8879, 3857, 1244, 8096, 694, 8776, 2] */;
|