feat: Implement core chat application UI, including chat, voice, members, DMs, and shared components.
Some checks failed
Build and Release / build-and-release (push) Failing after 0s

This commit is contained in:
Bryan1029384756
2026-02-14 01:57:15 -06:00
parent 6f12f98d30
commit 958cf56b23
51 changed files with 4761 additions and 1858 deletions

View File

@@ -229,6 +229,35 @@ export const afkMove = mutation({
},
});
export const disconnectUser = mutation({
args: {
actorUserId: v.id("userProfiles"),
targetUserId: v.id("userProfiles"),
},
returns: v.null(),
handler: async (ctx, args) => {
const roles = await getRolesForUser(ctx, args.actorUserId);
const canMove = roles.some(
(role) => (role.permissions as Record<string, boolean>)?.["move_members"]
);
if (!canMove) {
throw new Error("You don't have permission to disconnect members");
}
// Clear viewers watching the target user's stream
const allStates = await ctx.db.query("voiceStates").collect();
for (const s of allStates) {
if (s.watchingStream === args.targetUserId) {
await ctx.db.patch(s._id, { watchingStream: undefined });
}
}
await removeUserVoiceStates(ctx, args.targetUserId);
return null;
},
});
export const moveUser = mutation({
args: {
actorUserId: v.id("userProfiles"),