summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--chat.h2
-rw-r--r--handle.c17
-rw-r--r--ignore.c4
3 files changed, 12 insertions, 11 deletions
diff --git a/chat.h b/chat.h
index 764f8ec..e0266ef 100644
--- a/chat.h
+++ b/chat.h
@@ -269,7 +269,7 @@ extern struct Ignore {
 } ignore;
 const char *ignoreAdd(const char *pattern);
 bool ignoreRemove(const char *pattern);
-enum Heat ignoreCheck(enum Heat heat, const struct Message *msg);
+enum Heat ignoreCheck(enum Heat heat, uint id, const struct Message *msg);
 
 extern bool logEnable;
 void logFormat(uint id, const time_t *time, const char *format, ...)
diff --git a/handle.c b/handle.c
index 0719754..ef3f2b5 100644
--- a/handle.c
+++ b/handle.c
@@ -314,7 +314,7 @@ static void handleJoin(struct Message *msg) {
 		msg->params[2] = NULL;
 	}
 	uiFormat(
-		id, ignoreCheck(Cold, msg), tagTime(msg),
+		id, ignoreCheck(Cold, id, msg), tagTime(msg),
 		"\3%02d%s\3\t%s%s%sarrives in \3%02d%s\3",
 		hash(msg->user), msg->nick,
 		(msg->params[2] ? "(" : ""),
@@ -346,7 +346,7 @@ static void handlePart(struct Message *msg) {
 	completeRemove(id, msg->nick);
 	urlScan(id, msg->nick, msg->params[1]);
 	uiFormat(
-		id, ignoreCheck(Cold, msg), tagTime(msg),
+		id, ignoreCheck(Cold, id, msg), tagTime(msg),
 		"\3%02d%s\3\tleaves \3%02d%s\3%s%s",
 		hash(msg->user), msg->nick, hash(msg->params[0]), msg->params[0],
 		(msg->params[1] ? ": " : ""), (msg->params[1] ?: "")
@@ -393,7 +393,7 @@ static void handleNick(struct Message *msg) {
 			set(&idNames[id], msg->params[0]);
 		}
 		uiFormat(
-			id, ignoreCheck(Cold, msg), tagTime(msg),
+			id, ignoreCheck(Cold, id, msg), tagTime(msg),
 			"\3%02d%s\3\tis now known as \3%02d%s\3",
 			hash(msg->user), msg->nick, hash(msg->user), msg->params[0]
 		);
@@ -411,7 +411,7 @@ static void handleQuit(struct Message *msg) {
 	for (uint id; (id = completeID(msg->nick));) {
 		urlScan(id, msg->nick, msg->params[0]);
 		uiFormat(
-			id, ignoreCheck(Cold, msg), tagTime(msg),
+			id, ignoreCheck(Cold, id, msg), tagTime(msg),
 			"\3%02d%s\3\tleaves%s%s",
 			hash(msg->user), msg->nick,
 			(msg->params[0] ? ": " : ""), (msg->params[0] ?: "")
@@ -430,7 +430,7 @@ static void handleInvite(struct Message *msg) {
 	require(msg, true, 2);
 	if (!strcmp(msg->params[0], self.nick)) {
 		uiFormat(
-			Network, ignoreCheck(Hot, msg), tagTime(msg),
+			Network, ignoreCheck(Hot, Network, msg), tagTime(msg),
 			"\3%02d%s\3\tinvites you to \3%02d%s\3",
 			hash(msg->user), msg->nick, hash(msg->params[1]), msg->params[1]
 		);
@@ -1106,12 +1106,13 @@ static void handlePrivmsg(struct Message *msg) {
 	bool mention = !mine && isMention(msg);
 	if (!notice && !mine) completeTouch(id, msg->nick, hash(msg->user));
 	urlScan(id, msg->nick, msg->params[1]);
+	enum Heat heat = ignoreCheck((mention || query ? Hot : Warm), id, msg);
 	if (notice) {
 		if (id != Network) {
 			logFormat(id, tagTime(msg), "-%s- %s", msg->nick, msg->params[1]);
 		}
 		uiFormat(
-			id, ignoreCheck(Warm, msg), tagTime(msg),
+			id, ignoreCheck(Warm, id, msg), tagTime(msg),
 			"\3%d-%s-\3%d\t%s",
 			hash(msg->user), msg->nick, LightGray, msg->params[1]
 		);
@@ -1119,7 +1120,7 @@ static void handlePrivmsg(struct Message *msg) {
 		logFormat(id, tagTime(msg), "* %s %s", msg->nick, msg->params[1]);
 		const char *mentions = colorMentions(id, msg);
 		uiFormat(
-			id, ignoreCheck((mention || query ? Hot : Warm), msg), tagTime(msg),
+			id, heat, tagTime(msg),
 			"%s\35\3%d* %s\17\35\t%s%s",
 			(mention ? "\26" : ""), hash(msg->user), msg->nick,
 			mentions, msg->params[1]
@@ -1128,7 +1129,7 @@ static void handlePrivmsg(struct Message *msg) {
 		logFormat(id, tagTime(msg), "<%s> %s", msg->nick, msg->params[1]);
 		const char *mentions = colorMentions(id, msg);
 		uiFormat(
-			id, ignoreCheck((mention || query ? Hot : Warm), msg), tagTime(msg),
+			id, heat, tagTime(msg),
 			"%s\3%d<%s>\17\t%s%s",
 			(mention ? "\26" : ""), hash(msg->user), msg->nick,
 			mentions, msg->params[1]
diff --git a/ignore.c b/ignore.c
index d65c35a..8aa3e1b 100644
--- a/ignore.c
+++ b/ignore.c
@@ -58,11 +58,11 @@ bool ignoreRemove(const char *pattern) {
 	return found;
 }
 
-enum Heat ignoreCheck(enum Heat heat, const struct Message *msg) {
+enum Heat ignoreCheck(enum Heat heat, uint id, const struct Message *msg) {
 	char match[512];
 	snprintf(
 		match, sizeof(match), "%s!%s@%s %s %s",
-		msg->nick, msg->user, msg->host, msg->cmd, (msg->params[0] ?: "")
+		msg->nick, msg->user, msg->host, msg->cmd, idNames[id]
 	);
 	for (size_t i = 0; i < ignore.len; ++i) {
 		if (fnmatch(ignore.patterns[i], match, FNM_CASEFOLD)) continue;
>2017-07-31Add tupJune McEnroe 2017-07-31Use designated initializer for hnel tableJune McEnroe I did not know this syntax worked! 2017-07-30Add juneJune McEnroe 2017-07-30Play nethack as ValkyrieJune McEnroe 2017-07-28Add toggle to hnelJune McEnroe 2017-07-28Install slJune McEnroe 2017-07-25Add up, supJune McEnroe 2017-07-24Autopickup ringsJune McEnroe 2017-07-24Name dogJune McEnroe 2017-07-23Add nethackrcJune McEnroe 2017-07-23Remove useless setuid in briJune McEnroe Don't you think it would be better if the setuid bit only gave you permission to do it and didn't do it for you? 2017-07-23Clean up hnel a tiny bitJune McEnroe 2017-07-21Set window size in hnelJune McEnroe 2017-07-21Add hnelJune McEnroe 2017-07-19chmod 600 in dtchJune McEnroe