Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
183 lines
5.6 KiB
TypeScript
183 lines
5.6 KiB
TypeScript
// Module ID: 10338
|
|
// Function ID: 10339
|
|
// Name: useUserVoiceActivity
|
|
// Dependencies: [2045, 4469, 4855, 1085, 504, 2]
|
|
// Exports: canViewUserVoiceChannel, default, getUserVoiceState
|
|
|
|
// Module 10338 (useUserVoiceActivity)
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
import PermissionStore from "PermissionStore" /* 4469 */;
|
|
import VoiceStateStore from "VoiceStateStore" /* 4855 */;
|
|
|
|
const require = fn;
|
|
function getVisibleUserVoiceActivity(arg0, arg1) {
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
if (includeNonDiscoverable === undefined) {
|
|
includeNonDiscoverable = false;
|
|
}
|
|
let tmp3 = tmp;
|
|
if (tmp === undefined) {
|
|
tmp3 = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
|
} else {
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
}
|
|
}
|
|
if (null == userId) {
|
|
let tmp8 = tmp;
|
|
if (!tmp2) {
|
|
tmp8 = closure_6;
|
|
}
|
|
let channelId;
|
|
if (undefined != null) {
|
|
channelId = undefined.channelId;
|
|
}
|
|
if (null != channelId) {
|
|
ChannelStore = tmp8.ChannelStore;
|
|
const channel = ChannelStore.getChannel(undefined.channelId);
|
|
}
|
|
if (!tmp2) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp10 = null != undefined;
|
|
if (tmp10) {
|
|
let isPrivateResult;
|
|
if (channel != null) {
|
|
isPrivateResult = channel.isPrivate();
|
|
}
|
|
if (!isPrivateResult) {
|
|
PermissionStore = tmp.PermissionStore;
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
}
|
|
tmp10 = isPrivateResult;
|
|
}
|
|
if (tmp10) {
|
|
const obj = { voiceState: undefined, voiceChannel: channel };
|
|
let tmp13 = obj;
|
|
} else {
|
|
tmp13 = closure_7;
|
|
}
|
|
return tmp13;
|
|
} else {
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
|
} else {
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
}
|
|
}
|
|
const Permissions = fn(1085).Permissions;
|
|
let closure_6 = { ChannelStore, PermissionStore, VoiceStateStore };
|
|
let closure_7 = Object.freeze({ voiceState: "Array", voiceChannel: "flex" });
|
|
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 includeNonDiscoverable = userId.includeNonDiscoverable;
|
|
const items = [includeNonDiscoverable, PermissionStore, VoiceStateStore];
|
|
const items1 = [guildId, userId, includeNonDiscoverable];
|
|
return userId(guildId[4]).useStateFromStoresObject(items, () => getVisibleUserVoiceActivity({ userId, guildId, includeNonDiscoverable }, { ChannelStore, PermissionStore, VoiceStateStore }), items1);
|
|
};
|
|
export const getUserVoiceState = function getUserVoiceState(arg0) {
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
if (includeNonDiscoverable === undefined) {
|
|
includeNonDiscoverable = false;
|
|
}
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
|
} else {
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
}
|
|
}
|
|
if (null != userId) {
|
|
VoiceStateStore = tmp.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
|
} else {
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
}
|
|
};
|
|
export const canViewUserVoiceChannel = function canViewUserVoiceChannel(arg0) {
|
|
let tmp = arg1;
|
|
if (arg1 === undefined) {
|
|
tmp = closure_6;
|
|
}
|
|
({ userId, guildId, includeNonDiscoverable } = arg0);
|
|
if (includeNonDiscoverable === undefined) {
|
|
includeNonDiscoverable = false;
|
|
}
|
|
let tmp3 = tmp;
|
|
if (tmp === undefined) {
|
|
tmp3 = closure_6;
|
|
}
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
const VoiceStateStore2 = tmp3.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceState = VoiceStateStore2.getVoiceState(guildId, userId);
|
|
} else {
|
|
voiceState = VoiceStateStore2.getDiscoverableVoiceState(guildId, userId);
|
|
}
|
|
}
|
|
}
|
|
if (null == userId) {
|
|
let tmp8 = tmp;
|
|
if (!tmp2) {
|
|
tmp8 = closure_6;
|
|
}
|
|
let channelId;
|
|
if (undefined != null) {
|
|
channelId = undefined.channelId;
|
|
}
|
|
if (null != channelId) {
|
|
ChannelStore = tmp8.ChannelStore;
|
|
const channel = ChannelStore.getChannel(undefined.channelId);
|
|
}
|
|
if (!tmp2) {
|
|
tmp = closure_6;
|
|
}
|
|
let tmp10 = null != undefined;
|
|
if (tmp10) {
|
|
let isPrivateResult;
|
|
if (channel != null) {
|
|
isPrivateResult = channel.isPrivate();
|
|
}
|
|
if (!isPrivateResult) {
|
|
PermissionStore = tmp.PermissionStore;
|
|
isPrivateResult = PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
|
|
}
|
|
tmp10 = isPrivateResult;
|
|
}
|
|
return tmp10;
|
|
} else {
|
|
VoiceStateStore = tmp3.VoiceStateStore;
|
|
if (includeNonDiscoverable) {
|
|
let voiceStateForUser = VoiceStateStore.getVoiceStateForUser(userId);
|
|
} else {
|
|
voiceStateForUser = VoiceStateStore.getDiscoverableVoiceStateForUser(userId);
|
|
}
|
|
}
|
|
};
|
|
export { getVisibleUserVoiceActivity };
|