summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-16 14:04:53 -0500
committerJune McEnroe <june@causal.agency>2021-01-16 14:15:00 -0500
commit063f2aaa0c578ee54209b1ce31b0f584af583488 (patch)
treefdfa23847d747b08f8aa0b52b32462f43e9adab9 /handle.c
parentRename ignore code to filter (diff)
downloadcatgirl-063f2aaa0c578ee54209b1ce31b0f584af583488.tar.gz
catgirl-063f2aaa0c578ee54209b1ce31b0f584af583488.zip
Add -I highlight option and /highlight
Diffstat (limited to '')
-rw-r--r--handle.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/handle.c b/handle.c
index 702196b..ddf43e8 100644
--- a/handle.c
+++ b/handle.c
@@ -1198,8 +1198,9 @@ static void handlePrivmsg(struct Message *msg) {
 
 	bool notice = (msg->cmd[0] == 'N');
 	bool action = isAction(msg);
-	bool mention = !mine && isMention(msg);
-	enum Heat heat = filterCheck((mention || query ? Hot : Warm), id, msg);
+	bool highlight = !mine && isMention(msg);
+	enum Heat heat = filterCheck((highlight || query ? Hot : Warm), id, msg);
+	if (heat > Warm && !mine && !query) highlight = true;
 	if (!notice && !mine && heat > Ice) {
 		completeTouch(id, msg->nick, hash(msg->user));
 	}
@@ -1222,7 +1223,7 @@ static void handlePrivmsg(struct Message *msg) {
 		uiFormat(
 			id, heat, tagTime(msg),
 			"%s\35\3%d* %s\17\35\t%s%s",
-			(mention ? "\26" : ""), hash(msg->user), msg->nick,
+			(highlight ? "\26" : ""), hash(msg->user), msg->nick,
 			buf, msg->params[1]
 		);
 	} else {
@@ -1231,7 +1232,7 @@ static void handlePrivmsg(struct Message *msg) {
 		uiFormat(
 			id, heat, tagTime(msg),
 			"%s\3%d<%s>\17\t%s%s",
-			(mention ? "\26" : ""), hash(msg->user), msg->nick,
+			(highlight ? "\26" : ""), hash(msg->user), msg->nick,
 			buf, msg->params[1]
 		);
 	}