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)