add members from group, remove members from group, change title of group

This commit is contained in:
Soph :3 2026-01-11 14:57:39 +02:00
parent 7af96ca084
commit 17778e1736
9 changed files with 266 additions and 22 deletions

View file

@ -21,6 +21,13 @@ export function _sendToSubscribers(id: string, payload: unknown) {
}
}
}
export function _sendToUser(userId: string, payload: unknown) {
for (const [_, client] of _clients) {
if (client.userId == userId) {
client.controller.enqueue(`data: ${JSON.stringify(payload)}\n\n`);
}
}
}
export function _isUserConnected(userId: string): boolean {
for (const client of _clients.values()) {
@ -38,7 +45,7 @@ export async function GET({ locals, request }) {
//@TODO add more to subscribed eventually, server members, et cetera
const subscribed = locals.user.friends.map((f) => f.id);
subscribed.push(userId); // shit such as friend requests
const overwrite = locals.user.statusOverwrite;
const sessionId = crypto.randomUUID();