mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-03 16:32:00 +02:00
Websocket for contact deletion, radio contact deletion flag fix, resent message now appends sender name
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user