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

61 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 12201
// Function ID: 12202
2026-07-29 08:29:29 +00:00
// Name: useUserProfileVoiceActivity
2026-08-05 07:35:12 +00:00
// Dependencies: [4341, 4271, 7093, 9531, 589, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, isUserProfileVoiceActivityForChannel
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 12201 (useUserProfileVoiceActivity)
2026-07-29 08:29:29 +00:00
import sortActivity from "sortActivity";
import updateVoiceState from "updateVoiceState";
2026-07-23 10:11:24 +00:00
const require = arg1;
const result = require("isEmbeddedActivity").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;
2026-08-05 07:35:12 +00:00
const tmp2 = id(9531)({ 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;
}
2026-07-29 08:29:29 +00:00
const obj = { voiceState: tmp2.voiceState, voiceChannel, voiceActivity: null };
const items = [sortActivity, updateVoiceState];
obj[2] = userId(589).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
if (null != userId) {
if (null != id) {
2026-07-29 08:29:29 +00:00
const findActivityResult = outer1_3.findActivity(tmp, (session_id) => {
const voiceStateForSession = outer1_4.getVoiceStateForSession(closure_0, session_id.session_id);
let tmp3 = outer1_1(outer1_2[2])(session_id);
if (tmp3) {
let channelId;
if (voiceStateForSession != null) {
channelId = voiceStateForSession.channelId;
}
tmp3 = channelId === closure_1;
}
return tmp3;
});
return findActivityResult;
2026-07-20 16:05:17 +00:00
}
}
});
return obj;
};
2026-07-29 08:29:29 +00:00
export const isUserProfileVoiceActivityForChannel = function isUserProfileVoiceActivityForChannel(voiceStateForSession) {
let activity;
let voiceChannelId;
voiceStateForSession = voiceStateForSession.voiceStateForSession;
({ activity, voiceChannelId } = voiceStateForSession);
2026-08-05 07:35:12 +00:00
let tmp = importDefault(7093)(activity);
2026-07-29 08:29:29 +00:00
if (tmp) {
let channelId;
if (voiceStateForSession != null) {
channelId = voiceStateForSession.channelId;
}
tmp = channelId === voiceChannelId;
}
return tmp;
};