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.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/command.c b/command.c
index 8782ee6..5872bdc 100644
--- a/command.c
+++ b/command.c
@@ -348,6 +348,35 @@ static void commandCopy(uint id, char *params) {
 	urlCopyMatch(id, params);
 }
 
+static void commandIgnore(uint id, char *params) {
+	if (params) {
+		const char *pattern = ignoreAdd(params);
+		uiFormat(
+			id, Cold, NULL, "Ignoring \3%02d%s\3",
+			Brown, pattern
+		);
+	} else {
+		for (size_t i = 0; i < ignore.len; ++i) {
+			uiFormat(
+				Network, Warm, NULL, "Ignoring \3%02d%s\3",
+				Brown, ignore.patterns[i]
+			);
+		}
+	}
+}
+
+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);
+	}
+}
+
 static void commandExec(uint id, char *params) {
 	execID = id;
 
@@ -404,6 +433,7 @@ static const struct Handler {
 	{ "/except", commandExcept, 0 },
 	{ "/exec", commandExec, Multiline | Restricted },
 	{ "/help", commandHelp, 0 },
+	{ "/ignore", commandIgnore, 0 },
 	{ "/invex", commandInvex, 0 },
 	{ "/invite", commandInvite, 0 },
 	{ "/join", commandJoin, Restricted },
@@ -428,6 +458,7 @@ static const struct Handler {
 	{ "/topic", commandTopic, 0 },
 	{ "/unban", commandUnban, 0 },
 	{ "/unexcept", commandUnexcept, 0 },
+	{ "/unignore", commandUnignore, 0 },
 	{ "/uninvex", commandUninvex, 0 },
 	{ "/voice", commandVoice, 0 },
 	{ "/whois", commandWhois, 0 },
02:09:01 -0500'>2012-01-28Update to Quicktask 1.1June McEnroe 2012-01-22Use space-test branch of quicktaskJune McEnroe 2012-01-22Enable syntax-based foldingJune McEnroe 2012-01-22Update quicktaskJune McEnroe 2012-01-22Revert "Add AutoClose"June McEnroe 2012-01-22Revert "Disable powerline for now"June McEnroe 2012-01-22Revert "Add VCS repo directories to wildignore"June McEnroe 2012-01-22Disable powerline for nowJune McEnroe 2012-01-22Update some pluginsJune McEnroe 2012-01-22Add VCS repo directories to wildignoreJune McEnroe 2012-01-22Map ,e and ,b to CtrlP file and buffer respectivelyJune McEnroe 2012-01-22Add vim-spaceJune McEnroe 2012-01-22Add AutoCloseJune McEnroe 2012-01-22Add binding for GundoJune McEnroe 2012-01-22Add GundoJune McEnroe 2012-01-22Add Jellybeans colorschemeJune McEnroe 2012-01-22Add syntasticJune McEnroe 2012-01-21Add PowerlineJune McEnroe 2012-01-21Add quicktaskJune McEnroe 2012-01-15Moved comments out of mapsJune McEnroe 2012-01-14Disable scrollbarsJune McEnroe