Parse all CTCP messages
We display them nicely, however we never reply to them.
This commit is contained in:
+1
-1
@@ -304,7 +304,7 @@ export default class App extends Component {
|
||||
msgUnread = Unread.MESSAGE;
|
||||
}
|
||||
|
||||
if (msgUnread == Unread.HIGHLIGHT && window.Notification && Notification.permission === "granted" && !isDelivered) {
|
||||
if (msgUnread == Unread.HIGHLIGHT && window.Notification && Notification.permission === "granted" && !isDelivered && !irc.parseCTCP(msg)) {
|
||||
var title = "New " + kind + " from " + msg.prefix.name;
|
||||
if (this.isChannel(target)) {
|
||||
title += " in " + target;
|
||||
|
||||
+10
-6
@@ -60,12 +60,16 @@ class LogLine extends Component {
|
||||
case "PRIVMSG":
|
||||
var text = msg.params[1];
|
||||
|
||||
var actionPrefix = "\x01ACTION ";
|
||||
if (text.startsWith(actionPrefix) && text.endsWith("\x01")) {
|
||||
var action = text.slice(actionPrefix.length, -1);
|
||||
|
||||
lineClass = "me-tell";
|
||||
content = html`* ${createNick(msg.prefix.name)} ${linkify(stripANSI(action))}`;
|
||||
var ctcp = irc.parseCTCP(msg);
|
||||
if (ctcp) {
|
||||
if (ctcp.command == "ACTION") {
|
||||
lineClass = "me-tell";
|
||||
content = html`* ${createNick(msg.prefix.name)} ${linkify(stripANSI(ctcp.param))}`;
|
||||
} else {
|
||||
content = html`
|
||||
${createNick(msg.prefix.name)} has sent a CTCP command: ${ctcp.command} ${ctcp.param}
|
||||
`;
|
||||
}
|
||||
} else {
|
||||
lineClass = "talk";
|
||||
content = html`${"<"}${createNick(msg.prefix.name)}${">"} ${linkify(stripANSI(text))}`;
|
||||
|
||||
Reference in New Issue
Block a user