Avoid sending empty MONITOR command on startup

Closes: https://todo.sr.ht/~emersion/gamja/102
This commit is contained in:
Simon Ser 2021-08-30 10:14:05 +02:00
parent 73a2bcab94
commit c65ecd66eb

View File

@ -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(",")] });
}