summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Abell <galen@galenabell.com>2022-04-23 11:50:54 +0200
committerdelthas <delthas@dille.cc>2022-04-23 19:36:12 +0200
commit9bd580fc29a0af1cdcb094605396d6b531be5ed5 (patch)
tree9114c1eb8c5381ce7977ae7597a394253a7eec39
parentUse time.Parse for parsing incoming server times (diff)
Show error when searching if unsupported
It's confusing to search for something and have no results show if the server doesn't support the soju.im/search capability.
-rw-r--r--commands.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commands.go b/commands.go
index 03e999a..7eeefcd 100644
--- a/commands.go
+++ b/commands.go
@@ -597,6 +597,9 @@ func commandDoSearch(app *App, args []string) (err error) {
if s == nil {
return errOffline
}
+ if !s.HasCapability("soju.im/search") {
+ return errors.New("server does not support searching")
+ }
s.Search(channel, text)
return nil
}