Fix search
This commit is contained in:
parent
7c39436eda
commit
586706f02b
1 changed files with 3 additions and 3 deletions
|
@ -275,13 +275,13 @@ func handleSystemMessage(mxid string, msg string) {
|
||||||
case "search":
|
case "search":
|
||||||
account := findAccount(mxid, cmd[1])
|
account := findAccount(mxid, cmd[1])
|
||||||
if account != nil {
|
if account != nil {
|
||||||
rep, err := account.Conn.SearchForUsers(cmd[2])
|
rep, err := account.Conn.SearchForUsers(strings.Join(cmd[2:], " "))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ezbrSystemSendf(mxid, "Search error: %s", err)
|
ezbrSystemSendf(mxid, "Search error: %s", err)
|
||||||
} else {
|
} else {
|
||||||
ezbrSystemSendf(mxid, "%d users found", len(rep))
|
ezbrSystemSendf(mxid, "%d users found", len(rep))
|
||||||
for i, user := range rep {
|
for _, user := range rep {
|
||||||
ezbrSystemSendf(mxid, "- %s (%s)", i+1, user.DisplayName, user.ID)
|
ezbrSystemSendf(mxid, "- %s (%s)", user.DisplayName, user.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue