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 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)) {
|
||||
|
|
Loading…
Reference in a new issue