Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4791.js (118.4 MB)
60 lines
2.1 KiB
TypeScript
60 lines
2.1 KiB
TypeScript
// Module ID: 13135
|
|
// Function ID: 13136
|
|
// Name: useUserProfileVoiceActivity
|
|
// Dependencies: [4646, 4625, 7811, 10968, 504, 2]
|
|
// Exports: default, isUserProfileVoiceActivityForChannel
|
|
|
|
// Module 13135 (useUserProfileVoiceActivity)
|
|
import isEmbeddedActivityDefault from "isEmbeddedActivity" /* 7811 */;
|
|
import PresenceStore from "PresenceStore" /* 4646 */;
|
|
import VoiceStateStore from "VoiceStateStore" /* 4625 */;
|
|
|
|
const require = fn;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/user_profile/hooks/useUserProfileVoiceActivity.tsx");
|
|
|
|
export default function useUserProfileVoiceActivity(guildId) {
|
|
const userId = guildId.userId;
|
|
let id;
|
|
const tmp2 = id(10968)({ userId, guildId: guildId.guildId });
|
|
const voiceChannel = tmp2.voiceChannel;
|
|
id = undefined;
|
|
if (voiceChannel != null) {
|
|
id = voiceChannel.id;
|
|
}
|
|
const obj = { voiceState: tmp2.voiceState, voiceChannel, voiceActivity: null };
|
|
const items = [PresenceStore, VoiceStateStore];
|
|
obj.voiceActivity = userId(504).useStateFromStores(items, () => {
|
|
if (null != userId) {
|
|
if (null != id) {
|
|
const findActivityResult = PresenceStore.findActivity(tmp, (session_id) => {
|
|
voiceStateForSession = voiceStateForSession.getVoiceStateForSession(userId, session_id.session_id);
|
|
let tmp3 = id(dependencyMap[2])(session_id);
|
|
if (tmp3) {
|
|
let channelId;
|
|
if (voiceStateForSession != null) {
|
|
channelId = voiceStateForSession.channelId;
|
|
}
|
|
tmp3 = channelId === closure_1_1;
|
|
}
|
|
return tmp3;
|
|
});
|
|
return findActivityResult;
|
|
}
|
|
}
|
|
});
|
|
return obj;
|
|
};
|
|
export const isUserProfileVoiceActivityForChannel = function isUserProfileVoiceActivityForChannel(voiceStateForSession) {
|
|
voiceStateForSession = voiceStateForSession.voiceStateForSession;
|
|
({ activity, voiceChannelId } = voiceStateForSession);
|
|
let tmp = isEmbeddedActivityDefault(activity);
|
|
if (tmp) {
|
|
let channelId;
|
|
if (voiceStateForSession != null) {
|
|
channelId = voiceStateForSession.channelId;
|
|
}
|
|
tmp = channelId === voiceChannelId;
|
|
}
|
|
return tmp;
|
|
};
|