summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-16 17:02:22 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-16 17:17:29 +0200
commitf1791d1c6e7fc3ac4d27bb206b1bd61d80fe96f0 (patch)
treebb325625135245ccbef9018577d50ad08e52828c /app.go
parentui: Show /me from self when echo-message is off (diff)
Add a /topic command
Diffstat (limited to 'app.go')
-rw-r--r--app.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/app.go b/app.go
index f0ad553..3031bcd 100644
--- a/app.go
+++ b/app.go
@@ -318,6 +318,18 @@ func (app *App) handleInput(buffer, content string) {
}
app.s.Part(args)
+ case "TOPIC":
+ if buffer == ui.Home {
+ return
+ }
+
+ if args == "" {
+ topic := app.s.Topic(buffer)
+ line := fmt.Sprintf("\x0314Topic: %s", topic)
+ app.win.AddLine(buffer, ui.NewLineNow("--", line))
+ } else {
+ app.s.SetTopic(buffer, args)
+ }
case "ME":
if buffer == ui.Home {
return