From fdaf24fd0aff9e1089157fd65d81a5aa3fe550bd Mon Sep 17 00:00:00 2001 From: citrons Date: Mon, 2 Jun 2025 16:32:49 -0500 Subject: user statuses --- client/command.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'client/command.go') diff --git a/client/command.go b/client/command.go index 2c146e9..3122dc6 100644 --- a/client/command.go +++ b/client/command.go @@ -1,5 +1,9 @@ package main +import ( + "citrons.xyz/talk/proto" +) + func isCommand(text string) (bool, string) { if text[0] == '/' { if len(text) > 1 && text[1] == '/' { @@ -93,6 +97,18 @@ func (a *application) doCommand(command string, args []string, text string) { a.cmdWindow.Buffer().Add(msg) }) } + case "status": + if !a.authenticated { + break + } + cb := func(response proto.Command) { + if response.Kind == "fail" && len(response.Args) > 0 { + a.cmdWindow.fail(response.Args[0]) + } + } + a.sendUpdate(proto.Object { + "u", a.uid, map[string]string {"status": text}, + }, cb) case "create": if a.authenticated { a.createChannel(text) -- cgit v1.2.3