summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-16 13:30:59 -0500
committerJune McEnroe <june@causal.agency>2021-01-16 13:36:39 -0500
commit5a490945ea221cc94b05e2ed6e872a2ecbefe175 (patch)
treedaf471ca256c4112e78c9ff35795609e96fa969b /command.c
parentRemove join/part/quit ignore example (diff)
downloadcatgirl-5a490945ea221cc94b05e2ed6e872a2ecbefe175.tar.gz
catgirl-5a490945ea221cc94b05e2ed6e872a2ecbefe175.zip
Rename ignore code to filter
Diffstat (limited to '')
-rw-r--r--command.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/command.c b/command.c
index f6db311..f266878 100644
--- a/command.c
+++ b/command.c
@@ -388,19 +388,20 @@ static void commandCopy(uint id, char *params) {
 
 static void commandIgnore(uint id, char *params) {
 	if (params) {
-		struct Ignore ignore = ignoreAdd(params);
+		struct Filter filter = filterAdd(Ice, params);
 		uiFormat(
 			id, Cold, NULL, "Ignoring \3%02d%s %s %s %s",
-			Brown, ignore.mask,
-			(ignore.cmd ?: ""), (ignore.chan ?: ""), (ignore.mesg ?: "")
+			Brown, filter.mask,
+			(filter.cmd ?: ""), (filter.chan ?: ""), (filter.mesg ?: "")
 		);
 	} else {
-		for (size_t i = 0; i < IgnoreCap && ignores[i].mask; ++i) {
+		for (size_t i = 0; i < FilterCap && filters[i].mask; ++i) {
+			if (filters[i].heat != Ice) continue;
 			uiFormat(
 				Network, Warm, NULL, "Ignoring \3%02d%s %s %s %s",
-				Brown, ignores[i].mask,
-				(ignores[i].cmd ?: ""), (ignores[i].chan ?: ""),
-				(ignores[i].mesg ?: "")
+				Brown, filters[i].mask,
+				(filters[i].cmd ?: ""), (filters[i].chan ?: ""),
+				(filters[i].mesg ?: "")
 			);
 		}
 	}
@@ -408,12 +409,12 @@ static void commandIgnore(uint id, char *params) {
 
 static void commandUnignore(uint id, char *params) {
 	if (!params) return;
-	struct Ignore ignore = ignoreParse(params);
-	bool found = ignoreRemove(ignore);
+	struct Filter filter = filterParse(Ice, params);
+	bool found = filterRemove(filter);
 	uiFormat(
 		id, Cold, NULL, "%s ignoring \3%02d%s %s %s %s",
-		(found ? "No longer" : "Not"), Brown, ignore.mask,
-		(ignore.cmd ?: ""), (ignore.chan ?: ""), (ignore.mesg ?: "")
+		(found ? "No longer" : "Not"), Brown, filter.mask,
+		(filter.cmd ?: ""), (filter.chan ?: ""), (filter.mesg ?: "")
 	);
 }