components/buffer: drop duplicate MONITOR events

This commit is contained in:
Simon Ser 2023-11-10 18:11:34 +01:00
parent e0de4d1b36
commit 68cb6c56c4

View file

@ -660,7 +660,7 @@ export default class Buffer extends Component {
let hasUnreadSeparator = false;
let prevDate = new Date();
let foldMessages = [];
let hasMonitor = false;
let lastMonitor = null;
buf.messages.forEach((msg) => {
let sep = [];
@ -668,9 +668,12 @@ export default class Buffer extends Component {
return;
}
if (!hasMonitor && (msg.command === irc.RPL_MONONLINE || msg.command === irc.RPL_MONOFFLINE)) {
hasMonitor = true;
return;
if (msg.command === irc.RPL_MONONLINE || msg.command === irc.RPL_MONOFFLINE) {
let skip = !lastMonitor || msg.command === lastMonitor;
lastMonitor = msg.command;
if (skip) {
return;
}
}
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && !isMessageBeforeReceipt(msg, buf.prevReadReceipt)) {