From 24fe62f1de649da15bbf361a3b23afaf682209ff Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 28 May 2021 09:44:07 +0200 Subject: [PATCH] Ensure msg.prefix is always populated --- lib/client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/client.js b/lib/client.js index b4d1b54..1f7c0ba 100644 --- a/lib/client.js +++ b/lib/client.js @@ -145,6 +145,12 @@ export default class Client extends EventTarget { var msg = irc.parseMessage(event.data); console.debug("Received:", msg); + // If the prefix is missing, assume it's coming from the server on the + // other end of the connection + if (!msg.prefix) { + msg.prefix = this.serverPrefix; + } + var msgBatch = null; if (msg.tags["batch"]) { msgBatch = this.batches.get(msg.tags["batch"]);