summaryrefslogtreecommitdiff
path: root/client/command.go
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2025-06-02 16:32:49 -0500
committercitrons <citrons@mondecitronne.com>2025-06-02 16:36:36 -0500
commitfdaf24fd0aff9e1089157fd65d81a5aa3fe550bd (patch)
tree4b44f73af9cd139b698bf85dc23d6380b4f7d28a /client/command.go
parent30243fd5c596704d5e30b8ea19a05af1dd287d2e (diff)
user statuses
Diffstat (limited to 'client/command.go')
-rw-r--r--client/command.go16
1 files changed, 16 insertions, 0 deletions
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)