about summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/command.c b/command.c
index 43870f1..c71bebc 100644
--- a/command.c
+++ b/command.c
@@ -388,16 +388,19 @@ static void commandCopy(uint id, char *params) {
 
 static void commandIgnore(uint id, char *params) {
 	if (params) {
-		const char *pattern = ignoreAdd(params);
+		struct Ignore ignore = ignoreAdd(params);
 		uiFormat(
-			id, Cold, NULL, "Ignoring \3%02d%s\3",
-			Brown, pattern
+			id, Cold, NULL, "Ignoring \3%02d%s %s %s %s",
+			Brown, ignore.mask,
+			(ignore.cmd ?: ""), (ignore.chan ?: ""), (ignore.mesg ?: "")
 		);
 	} else {
-		for (size_t i = 0; i < ignore.len; ++i) {
+		for (size_t i = 0; i < IgnoreCap && ignores[i].mask; ++i) {
 			uiFormat(
-				Network, Warm, NULL, "Ignoring \3%02d%s\3",
-				Brown, ignore.patterns[i]
+				Network, Warm, NULL, "Ignoring \3%02d%s %s %s %s",
+				Brown, ignores[i].mask,
+				(ignores[i].cmd ?: ""), (ignores[i].chan ?: ""),
+				(ignores[i].mesg ?: "")
 			);
 		}
 	}
@@ -405,14 +408,13 @@ static void commandIgnore(uint id, char *params) {
 
 static void commandUnignore(uint id, char *params) {
 	if (!params) return;
-	if (ignoreRemove(params)) {
-		uiFormat(
-			id, Cold, NULL, "No longer ignoring \3%02d%s\3",
-			Brown, params
-		);
-	} else {
-		uiFormat(id, Cold, NULL, "Not ignoring \3%02d%s\3", Brown, params);
-	}
+	struct Ignore ignore = ignoreParse(params);
+	bool found = ignoreRemove(ignore);
+	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 ?: "")
+	);
 }
 
 static void commandExec(uint id, char *params) {
c/commit/home/.ssh/config?id=82c4c4b0f28a64120aa76f85e5eee01a06225ef6&follow=1'>Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe