From 9a63155b2d000efacc474ca4fe5ac007afb4a93e Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sun, 2 Sep 2018 01:06:45 -0400 Subject: [PATCH] Treat all direct messages as pings --- handle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/handle.c b/handle.c index 865bbad..5058e34 100644 --- a/handle.c +++ b/handle.c @@ -370,7 +370,8 @@ static void handleCTCP(struct Tag tag, char *nick, char *user, char *mesg) { static void handlePrivmsg(char *prefix, char *params) { char *nick, *user, *chan, *mesg; shift(prefix, &nick, &user, NULL, params, 2, 0, &chan, &mesg); - struct Tag tag = (strcmp(chan, self.nick) ? tagFor(chan) : tagFor(nick)); + bool direct = !strcmp(chan, self.nick); + struct Tag tag = (direct ? tagFor(nick) : tagFor(chan)); if (mesg[0] == '\1') { handleCTCP(tag, nick, user, mesg); return; @@ -380,7 +381,7 @@ static void handlePrivmsg(char *prefix, char *params) { if (!self) tabTouch(tag, nick); urlScan(tag, mesg); - bool ping = !self && isPing(mesg); + bool ping = !self && (direct || isPing(mesg)); uiFmt( tag, (ping ? UI_HOT : UI_WARM), "%c\3%d%c%s%c\17 %s",