commit 9bd580f

Galen Abell  ·  2022-04-23 09:50:54 +0000 UTC
parent 8123af1
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.
1 files changed,  +3, -0
+3, -0
 1@@ -597,6 +597,9 @@ func commandDoSearch(app *App, args []string) (err error) {
 2 	if s == nil {
 3 		return errOffline
 4 	}
 5+	if !s.HasCapability("soju.im/search") {
 6+		return errors.New("server does not support searching")
 7+	}
 8 	s.Search(channel, text)
 9 	return nil
10 }