From c65ecd66eba1890a171198094f6a32d60060063f Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 30 Aug 2021 10:14:05 +0200 Subject: [PATCH] Avoid sending empty MONITOR command on startup Closes: https://todo.sr.ht/~emersion/gamja/102 --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 6bf4cbd..6a49de2 100644 --- a/lib/client.js +++ b/lib/client.js @@ -201,7 +201,7 @@ export default class Client extends EventTarget { if (changed.indexOf("CASEMAPPING") >= 0) { this.setCaseMapping(this.isupport.get("CASEMAPPING")); } - if (changed.indexOf("MONITOR") >= 0 && this.isupport.has("MONITOR")) { + if (changed.indexOf("MONITOR") >= 0 && this.isupport.has("MONITOR") && this.monitored.size > 0) { let targets = Array.from(this.monitored.keys()).slice(0, this.maxMonitorTargets()); this.send({ command: "MONITOR", params: ["+", targets.join(",")] }); }