Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
148 lines
4.6 KiB
TypeScript
148 lines
4.6 KiB
TypeScript
// Module ID: 10949
|
|
// Function ID: 10950
|
|
// Name: useUserVoiceActivity
|
|
// Dependencies: [1957, 4243, 4624, 1085, 504, 2]
|
|
// Exports: canViewUserVoiceChannel, default, getUserVoiceState
|
|
|
|
// Module 10949 (useUserVoiceActivity)
|
|
import ChannelStore from "ChannelStore" /* 1957 */;
|
|
import PermissionStore from "PermissionStore" /* 4243 */;
|
|
import VoiceStateStore from "VoiceStateStore" /* 4624 */;
|
|
|
|
const require = fn;
|
|
function getVisibleUserVoiceActivity(arg0, arg1) {
|
|
({ userId, guildId } = arg0);
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp3 = tmp;
|
|
if (tmp === undefined) {
|
|
tmp3 = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
let discoverableVoiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
let tmp5 = tmp;
|
|
if (!tmp2) {
|
|
tmp5 = closure_6;
|
|
}
|
|
let channelId;
|
|
if (discoverableVoiceState != null) {
|
|
channelId = discoverableVoiceState.channelId;
|
|
}
|
|
if (null != channelId) {
|
|
ChannelStore = tmp5.ChannelStore;
|
|
const channel = ChannelStore.getChannel(discoverableVoiceState.channelId);
|
|
}
|
|
if (!tmp2) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp7 = null != discoverableVoiceState;
|
|
if (tmp7) {
|
|
let isPrivateResult;
|
|
if (channel != null) {
|
|
isPrivateResult = channel.isPrivate();
|
|
}
|
|
if (!isPrivateResult) {
|
|
PermissionStore = tmp.PermissionStore;
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
}
|
|
tmp7 = isPrivateResult;
|
|
}
|
|
if (tmp7) {
|
|
const obj = { voiceState: discoverableVoiceState, voiceChannel: channel };
|
|
let tmp10 = obj;
|
|
} else {
|
|
tmp10 = closure_7;
|
|
}
|
|
return tmp10;
|
|
}
|
|
if (null != userId) {
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
discoverableVoiceState = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
}
|
|
const Permissions = fn(1085).Permissions;
|
|
let closure_6 = { ChannelStore, PermissionStore, VoiceStateStore };
|
|
let closure_7 = Object.freeze({ voiceState: "call", voiceChannel: "accessibilityLabel" });
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/activity_status/useUserVoiceActivity.tsx");
|
|
|
|
export default function useUserVoiceActivity(userId) {
|
|
userId = userId.userId;
|
|
const guildId = userId.guildId;
|
|
const items = [ChannelStore, PermissionStore, VoiceStateStore];
|
|
const items1 = [guildId, userId];
|
|
return userId(guildId[4]).useStateFromStoresObject(items, () => getVisibleUserVoiceActivity({ userId, guildId }, { ChannelStore, PermissionStore, VoiceStateStore }), items1);
|
|
};
|
|
export const getUserVoiceState = function getUserVoiceState(arg0) {
|
|
({ userId, guildId } = arg0);
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp.VoiceStateStore;
|
|
let discoverableVoiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
return discoverableVoiceState;
|
|
}
|
|
if (null != userId) {
|
|
VoiceStateStore = tmp.VoiceStateStore;
|
|
discoverableVoiceState = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
};
|
|
export const canViewUserVoiceChannel = function canViewUserVoiceChannel(arg0) {
|
|
({ userId, guildId } = arg0);
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp3 = tmp;
|
|
if (tmp === undefined) {
|
|
tmp3 = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
let discoverableVoiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
let tmp5 = tmp;
|
|
if (!tmp2) {
|
|
tmp5 = closure_6;
|
|
}
|
|
let channelId;
|
|
if (discoverableVoiceState != null) {
|
|
channelId = discoverableVoiceState.channelId;
|
|
}
|
|
if (null != channelId) {
|
|
ChannelStore = tmp5.ChannelStore;
|
|
const channel = ChannelStore.getChannel(discoverableVoiceState.channelId);
|
|
}
|
|
if (!tmp2) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp7 = null != discoverableVoiceState;
|
|
if (tmp7) {
|
|
let isPrivateResult;
|
|
if (channel != null) {
|
|
isPrivateResult = channel.isPrivate();
|
|
}
|
|
if (!isPrivateResult) {
|
|
PermissionStore = tmp.PermissionStore;
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
}
|
|
tmp7 = isPrivateResult;
|
|
}
|
|
return tmp7;
|
|
}
|
|
if (null != userId) {
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
discoverableVoiceState = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
};
|
|
export { getVisibleUserVoiceActivity };
|