decord/source/modules/user_profile/hooks/useUserProfileVoiceActivity.tsx

61 lines
2.1 KiB
TypeScript
Raw Normal View History

// Module ID: 13135
// Function ID: 13136
2026-07-29 08:29:29 +00:00
// Name: useUserProfileVoiceActivity
// Dependencies: [4646, 4625, 7811, 10968, 504, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, isUserProfileVoiceActivityForChannel
2026-07-20 16:05:17 +00:00
// Module 13135 (useUserProfileVoiceActivity)
import isEmbeddedActivityDefault from "isEmbeddedActivity" /* 7811 */;
import PresenceStore from "PresenceStore" /* 4646 */;
import VoiceStateStore from "VoiceStateStore" /* 4625 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/user_profile/hooks/useUserProfileVoiceActivity.tsx");
2026-07-20 16:05:17 +00:00
export default function useUserProfileVoiceActivity(guildId) {
const userId = guildId.userId;
let id;
const tmp2 = id(10968)({ userId, guildId: guildId.guildId });
2026-07-29 08:29:29 +00:00
const voiceChannel = tmp2.voiceChannel;
2026-07-23 10:11:24 +00:00
id = undefined;
2026-07-29 08:29:29 +00:00
if (voiceChannel != null) {
2026-07-20 16:05:17 +00:00
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;
2026-07-29 08:29:29 +00:00
}
tmp3 = channelId === closure_1_1;
}
return tmp3;
});
return findActivityResult;
2026-07-20 16:05:17 +00:00
}
}
});
2026-07-20 16:05:17 +00:00
return obj;
};
2026-07-29 08:29:29 +00:00
export const isUserProfileVoiceActivityForChannel = function isUserProfileVoiceActivityForChannel(voiceStateForSession) {
voiceStateForSession = voiceStateForSession.voiceStateForSession;
({ activity, voiceChannelId } = voiceStateForSession);
2026-08-24 06:08:38 +00:00
let tmp = isEmbeddedActivityDefault(activity);
2026-07-29 08:29:29 +00:00
if (tmp) {
let channelId;
if (voiceStateForSession != null) {
channelId = voiceStateForSession.channelId;
}
tmp = channelId === voiceChannelId;
}
return tmp;
};