| author | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-11-06 04:54:07 UTC |
| committer | Stephen Paul Weber
<singpolyma@singpolyma.net> 2025-11-06 04:54:07 UTC |
| parent | 666187d80381c9063ff41c6b5619e787f0608580 |
| borogove/Client.hx | +4 | -0 |
diff --git a/borogove/Client.hx b/borogove/Client.hx index fc51eda..7cfafce 100644 --- a/borogove/Client.hx +++ b/borogove/Client.hx @@ -881,9 +881,13 @@ class Client extends EventEmitter { @param callback takes two arguments, the query that was used and the array of results **/ public function findAvailableChats(q:String, callback:(String, Array<AvailableChat>) -> Bool) { + var haveJid: Map<String, Bool> = []; var results = []; final query = StringTools.trim(q); final checkAndAdd = (jid: JID, prepend = false) -> { + if (haveJid[jid.asString()]) return; + haveJid[jid.asString()] = true; + final add = (item) -> prepend ? results.unshift(item) : results.push(item); final discoGet = new DiscoInfoGet(jid.asString()); discoGet.onFinished(() -> {