Fix search

This commit is contained in:
Alex 2020-03-09 18:05:53 +01:00
parent 7c39436eda
commit 586706f02b

View file

@ -275,13 +275,13 @@ func handleSystemMessage(mxid string, msg string) {
case "search":
account := findAccount(mxid, cmd[1])
if account != nil {
rep, err := account.Conn.SearchForUsers(cmd[2])
rep, err := account.Conn.SearchForUsers(strings.Join(cmd[2:], " "))
if err != nil {
ezbrSystemSendf(mxid, "Search error: %s", err)
} else {
ezbrSystemSendf(mxid, "%d users found", len(rep))
for i, user := range rep {
ezbrSystemSendf(mxid, "- %s (%s)", i+1, user.DisplayName, user.ID)
for _, user := range rep {
ezbrSystemSendf(mxid, "- %s (%s)", user.DisplayName, user.ID)
}
}
} else {