mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
components/buffer: drop duplicate MONITOR events
This commit is contained in:
parent
e0de4d1b36
commit
68cb6c56c4
1 changed files with 7 additions and 4 deletions
|
@ -660,7 +660,7 @@ export default class Buffer extends Component {
|
||||||
let hasUnreadSeparator = false;
|
let hasUnreadSeparator = false;
|
||||||
let prevDate = new Date();
|
let prevDate = new Date();
|
||||||
let foldMessages = [];
|
let foldMessages = [];
|
||||||
let hasMonitor = false;
|
let lastMonitor = null;
|
||||||
buf.messages.forEach((msg) => {
|
buf.messages.forEach((msg) => {
|
||||||
let sep = [];
|
let sep = [];
|
||||||
|
|
||||||
|
@ -668,9 +668,12 @@ export default class Buffer extends Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasMonitor && (msg.command === irc.RPL_MONONLINE || msg.command === irc.RPL_MONOFFLINE)) {
|
if (msg.command === irc.RPL_MONONLINE || msg.command === irc.RPL_MONOFFLINE) {
|
||||||
hasMonitor = true;
|
let skip = !lastMonitor || msg.command === lastMonitor;
|
||||||
return;
|
lastMonitor = msg.command;
|
||||||
|
if (skip) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && !isMessageBeforeReceipt(msg, buf.prevReadReceipt)) {
|
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && !isMessageBeforeReceipt(msg, buf.prevReadReceipt)) {
|
||||||
|
|
Loading…
Reference in a new issue