Show MONITOR online/offline notifications in user buffers
We were only showing QUIT, which was weird because it wouldn't say when the user becomes online again. Use MONITOR instead.
This commit is contained in:
parent
97b5970acb
commit
5e33919cce
2 changed files with 24 additions and 4 deletions
|
@ -267,6 +267,13 @@ class LogLine extends Component {
|
|||
let date = new Date(parseInt(msg.params[2], 10) * 1000);
|
||||
content = html`Channel was created on ${date.toLocaleString()}`;
|
||||
break;
|
||||
// MONITOR messages are only displayed in user buffers
|
||||
case irc.RPL_MONONLINE:
|
||||
content = html`${createNick(buf.name)} is online`;
|
||||
break;
|
||||
case irc.RPL_MONOFFLINE:
|
||||
content = html`${createNick(buf.name)} is offline`;
|
||||
break;
|
||||
default:
|
||||
if (irc.isError(msg.command) && msg.command != irc.ERR_NOMOTD) {
|
||||
lineClass = "error";
|
||||
|
@ -653,6 +660,7 @@ export default class Buffer extends Component {
|
|||
let hasUnreadSeparator = false;
|
||||
let prevDate = new Date();
|
||||
let foldMessages = [];
|
||||
let hasMonitor = false;
|
||||
buf.messages.forEach((msg) => {
|
||||
let sep = [];
|
||||
|
||||
|
@ -660,6 +668,11 @@ export default class Buffer extends Component {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!hasMonitor && (msg.command === irc.RPL_MONONLINE || msg.command === irc.RPL_MONOFFLINE)) {
|
||||
hasMonitor = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasUnreadSeparator && buf.type != BufferType.SERVER && !isMessageBeforeReceipt(msg, buf.prevReadReceipt)) {
|
||||
sep.push(html`<${UnreadSeparator} key="unread"/>`);
|
||||
hasUnreadSeparator = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue