diff options
author | Galen Abell <galen@galenabell.com> | 2022-04-23 11:50:54 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-04-23 19:36:12 +0200 |
commit | 9bd580fc29a0af1cdcb094605396d6b531be5ed5 (patch) | |
tree | 9114c1eb8c5381ce7977ae7597a394253a7eec39 /commands.go | |
parent | Use 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.
Diffstat (limited to 'commands.go')
-rw-r--r-- | commands.go | 3 |
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 } |