feat: real-time sync, notification & social system overhaul

- Add WS events: dm_channel_created, dm_channel_closed, friend_removed,
  channel_created/updated/deleted, server_updated
- Fix first-ever DM: broadcast dm_channel_created to recipient
- Add DELETE /api/dm/:id for closing DMs with re-open support
- Wire Close DM button in sidebar
- Fix dm_message_created for unknown channels (safety net)
- Broadcast friend_removed on friend deletion
- Sound system: track realtimeMessageEvents separately from API loads,
  play notification for messages in all channels, not just current
- Optimistic updates: send/edit/delete messages appear instantly with
  rollback on failure, temp message deduplication on WS echo
- Channel CRUD broadcasts to all server members
- Server update broadcast on PATCH
- Server join registers user in connectionManager immediately
- Reconnect: only reload current channel, preserve other channel caches
- Activity panel, right panel, member list toggle components
This commit is contained in:
Jannis Braun
2026-02-22 22:15:11 +01:00
parent 708bdf5468
commit 6b8fd44a3a
35 changed files with 1002 additions and 262 deletions
+1
View File
@@ -91,6 +91,7 @@ export const api = {
dm: {
list: () => request('GET', '/dm'),
create: (data) => request('POST', '/dm', data),
close: (id) => request('DELETE', `/dm/${id}`),
messages: (id, before, limit = 50) => {
const params = new URLSearchParams();
if (before)
+1
View File
@@ -149,6 +149,7 @@ export const api = {
dm: {
list: () => request<DmChannel[]>('GET', '/dm'),
create: (data: CreateDmRequest) => request<DmChannel>('POST', '/dm', data),
close: (id: string) => request<{ success: boolean }>('DELETE', `/dm/${id}`),
messages: (id: string, before?: string, limit = 50) => {
const params = new URLSearchParams();
if (before) params.set('before', before);