decord/source/modules/user_profile/hooks/useUserProfileVoiceActivity.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

60 lines
2.1 KiB
TypeScript

// Module ID: 13112
// Function ID: 13113
// Name: useUserProfileVoiceActivity
// Dependencies: [4645, 4624, 7790, 10949, 504, 2]
// Exports: default, isUserProfileVoiceActivityForChannel
// Module 13112 (useUserProfileVoiceActivity)
import isEmbeddedActivityDefault from "isEmbeddedActivity" /* 7790 */;
import PresenceStore from "PresenceStore" /* 4645 */;
import VoiceStateStore from "VoiceStateStore" /* 4624 */;
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(10949)({ 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;
};