Treat all direct messages as pings
parent
e5663d45df
commit
9a63155b2d
5
handle.c
5
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) {
|
static void handlePrivmsg(char *prefix, char *params) {
|
||||||
char *nick, *user, *chan, *mesg;
|
char *nick, *user, *chan, *mesg;
|
||||||
shift(prefix, &nick, &user, NULL, params, 2, 0, &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') {
|
if (mesg[0] == '\1') {
|
||||||
handleCTCP(tag, nick, user, mesg);
|
handleCTCP(tag, nick, user, mesg);
|
||||||
return;
|
return;
|
||||||
|
@ -380,7 +381,7 @@ static void handlePrivmsg(char *prefix, char *params) {
|
||||||
if (!self) tabTouch(tag, nick);
|
if (!self) tabTouch(tag, nick);
|
||||||
|
|
||||||
urlScan(tag, mesg);
|
urlScan(tag, mesg);
|
||||||
bool ping = !self && isPing(mesg);
|
bool ping = !self && (direct || isPing(mesg));
|
||||||
uiFmt(
|
uiFmt(
|
||||||
tag, (ping ? UI_HOT : UI_WARM),
|
tag, (ping ? UI_HOT : UI_WARM),
|
||||||
"%c\3%d%c%s%c\17 %s",
|
"%c\3%d%c%s%c\17 %s",
|
||||||
|
|
Loading…
Reference in New Issue