89 lines
5.3 KiB
TypeScript
89 lines
5.3 KiB
TypeScript
/* Metro module 8832; source: modules/activity_status/useUserVoiceActivity.tsx; dependencies: [1379, 3784, 4297, 482, 566, 2] */
|
|
function _fun68988(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:6, offset: 0x01c63e86, size: 297 bytes, params: 8, frame: 22
|
|
let env0_0 = require;
|
|
const closure = getUserVoiceState;
|
|
const closure2 = getVisibleUserVoiceActivity;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
const env0_5 = (require(482) /* metro dependency 482: Constants */).Permissions;
|
|
object = {ChannelStore: channelStore, PermissionStore: permissionStore, VoiceStateStore: voiceStateStore};
|
|
Object = global.Object;
|
|
const env0_7 = Object.freeze({voiceState: undefined, voiceChannel: undefined});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activity_status/useUserVoiceActivity.tsx');
|
|
exports.default = function(a0) {
|
|
var userId = a0.userId;
|
|
var env0_0 = userId;
|
|
var guildId = a0.guildId;
|
|
var env0_1 = guildId;
|
|
return require(dependencyMap[4]).useStateFromStoresObject([ChannelStore, PermissionStore, VoiceStateStore],
|
|
_fun68994, [guildId, userId]);
|
|
};
|
|
exports.getUserVoiceState = closure;
|
|
exports.canViewUserVoiceChannel = canViewUserVoiceChannel;
|
|
exports.getVisibleUserVoiceActivity = closure2;
|
|
}
|
|
|
|
function getUserVoiceState({userId, guildId}) { // fn#68989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:203, offset: 0x01c63faf, size: 89 bytes, params: 2, frame: 15
|
|
const value = a1;
|
|
const r1 = value !== undefined ? value : env0_6;
|
|
return guildId == null ? userId != null ? r1.VoiceStateStore.getDiscoverableVoiceStateForUser(userId) : undefined : userId != null ? r1.VoiceStateStore.getDiscoverableVoiceState(guildId,
|
|
userId) : userId != null ? r1.VoiceStateStore.getDiscoverableVoiceStateForUser(userId) : undefined;
|
|
}
|
|
|
|
function getUserVoiceChannel({voiceState}) { // fn#68990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:398, offset: 0x01c64008, size: 70 bytes, params: 2, frame: 14
|
|
var ChannelStore;
|
|
const value = a1;
|
|
if (voiceState?.channelId != null) {
|
|
ChannelStore = (value !== undefined ? value : env0_6).ChannelStore;
|
|
return ChannelStore.getChannel(voiceState.channelId);
|
|
}
|
|
}
|
|
|
|
function canViewVoiceChannel({voiceState, voiceChannel}) { // fn#68991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:531, offset: 0x01c6404e, size: 98 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var r0;
|
|
let value = a1;
|
|
const r2 = value !== undefined ? value : env0_6;
|
|
value = voiceState != null;
|
|
if (value) {
|
|
r1 = voiceChannel?.isPrivate();
|
|
r1 = !r1 ? r2.PermissionStore.can(Permissions.VIEW_CHANNEL, voiceChannel) : r1;
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getVisibleUserVoiceActivity({userId, guildId}) { // fn#68992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:746, offset: 0x01c640b0, size: 117 bytes, params: 2, frame: 17
|
|
const value = a1;
|
|
const r6 = value !== undefined ? value : env0_6;
|
|
const userVoiceState = getUserVoiceState({userId: userId, guildId: guildId}, r6);
|
|
const userVoiceChannel = getUserVoiceChannel({voiceState: userVoiceState}, r6);
|
|
return canViewVoiceChannel({voiceState: userVoiceState, voiceChannel: userVoiceChannel},
|
|
r6) ? {voiceState: userVoiceState, voiceChannel: userVoiceChannel} : env0_7;
|
|
}
|
|
|
|
function useUserVoiceActivity({userId, guildId}) { // fn#68993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:1081, offset: 0x01c64125, size: 110 bytes, params: 2, frame: 18
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore, PermissionStore,
|
|
VoiceStateStore], function() {
|
|
return getVisibleUserVoiceActivity({userId: userId, guildId: guildId}, {ChannelStore: ChannelStore,
|
|
PermissionStore: PermissionStore, VoiceStateStore: VoiceStateStore});
|
|
}, [guildId, userId]);
|
|
}
|
|
|
|
function canViewUserVoiceChannel({userId, guildId}) { // fn#68995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9017:1362, offset: 0x01c641d6, size: 93 bytes, params: 2, frame: 16
|
|
var object2;
|
|
const value = a1;
|
|
const r3 = value !== undefined ? value : env0_6;
|
|
const userVoiceState = getUserVoiceState({userId: userId, guildId: guildId}, r3);
|
|
const canViewVoiceChannelBinding = canViewVoiceChannel;
|
|
object2 = {voiceState: userVoiceState};
|
|
object2.voiceChannel = getUserVoiceChannel({voiceState: userVoiceState}, r3);
|
|
return canViewVoiceChannelBinding(object2, r3);
|
|
}
|
|
|