Ensure msg.prefix is always populated

This commit is contained in:
Simon Ser 2021-05-28 09:44:07 +02:00
parent e9d90d4927
commit 24fe62f1de

View file

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