Websocket for contact deletion, radio contact deletion flag fix, resent message now appends sender name

This commit is contained in:
Jack Kingsman
2026-03-03 12:43:27 -08:00
parent 73d4647cfc
commit 8fa37fe6dc
6 changed files with 45 additions and 0 deletions
+8
View File
@@ -20,6 +20,8 @@ interface UseWebSocketOptions {
onHealth?: (health: HealthStatus) => void;
onMessage?: (message: Message) => void;
onContact?: (contact: Contact) => void;
onContactDeleted?: (publicKey: string) => void;
onChannelDeleted?: (key: string) => void;
onRawPacket?: (packet: RawPacket) => void;
onMessageAcked?: (messageId: number, ackCount: number, paths?: MessagePath[]) => void;
onError?: (error: ErrorEvent) => void;
@@ -103,6 +105,12 @@ export function useWebSocket(options: UseWebSocketOptions) {
case 'contact':
handlers.onContact?.(msg.data as Contact);
break;
case 'contact_deleted':
handlers.onContactDeleted?.((msg.data as { public_key: string }).public_key);
break;
case 'channel_deleted':
handlers.onChannelDeleted?.((msg.data as { key: string }).key);
break;
case 'raw_packet':
handlers.onRawPacket?.(msg.data as RawPacket);
break;