From 27cce022a4274a4d1dbba13813bc56f8a2075b66 Mon Sep 17 00:00:00 2001 From: Sisi Date: Sun, 5 Apr 2026 13:10:37 +0200 Subject: [PATCH] add client client messaging --- machine-client/index.html | 10 ++++++++++ main.go | 1 + 2 files changed, 11 insertions(+) diff --git a/machine-client/index.html b/machine-client/index.html index 472fef5..26f5d22 100644 --- a/machine-client/index.html +++ b/machine-client/index.html @@ -82,6 +82,7 @@ + @@ -235,6 +236,15 @@ ], submit: () => httpPost('/del/group', { token:'dg-token', groupid:'dg-groupid' }) }, + 'msg-user': { + title: 'POST /msg/user — send direct message to user', + fields: [ + { id: 'mu-token', label: 'token', ph: '' }, + { id: 'mu-recipientid', label: 'recipientid', ph: 'uint32' }, + { id: 'mu-message', label: 'message', ph: 'message text' }, + ], + submit: () => httpPost('/msg/user', { token:'mu-token', recipientid:'mu-recipientid', message:'mu-message' }) + }, 'msg-group': { title: 'POST /msg/group — send message to group', fields: [ diff --git a/main.go b/main.go index a7c46e0..48ddf6e 100644 --- a/main.go +++ b/main.go @@ -37,6 +37,7 @@ func main() { http.HandleFunc("/get/group/members", withCORS(HttpHandleGroupMembersGet)) http.HandleFunc("/del/group", withCORS(HttpHandleGroupDelete)) + http.HandleFunc("/msg/user", withCORS(HttpHandleUserMessage)) http.HandleFunc("/msg/group", withCORS(HttpHandleGroupMessage)) http.HandleFunc("/ws", ServeWsConnection)