summary refs log tree commit diff
path: root/command.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-08 02:26:00 -0500
committerJune McEnroe <june@causal.agency>2020-02-08 02:26:00 -0500
commit943502ea82b3965b4f652146ca03262ac6390f83 (patch)
tree74880a218a8cf4ec0c5ddb0396364897619c0fc2 /command.c
parentCheck return values of newwin/newpad (diff)
downloadcatgirl-943502ea82b3965b4f652146ca03262ac6390f83.tar.gz
catgirl-943502ea82b3965b4f652146ca03262ac6390f83.zip
Add /close
Diffstat (limited to '')
-rw-r--r--command.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/command.c b/command.c
index 9047e95..e33c57e 100644
--- a/command.c
+++ b/command.c
@@ -100,10 +100,22 @@ static void commandWindow(size_t id, char *params) {
 	}
 }
 
+static void commandClose(size_t id, char *params) {
+	if (!params) {
+		uiCloseID(id);
+	} else if (isdigit(params[0])) {
+		uiCloseNum(strtoul(params, NULL, 10));
+	} else {
+		id = idFind(params);
+		if (id) uiCloseID(id);
+	}
+}
+
 static const struct Handler {
 	const char *cmd;
 	Command *fn;
 } Commands[] = {
+	{ "/close", commandClose },
 	{ "/join", commandJoin },
 	{ "/me", commandMe },
 	{ "/nick", commandNick },
d>Error on invalid ISUPPORT values 1.2June McEnroe 2020-04-05Only set RCS on FreeBSDJune McEnroe 2020-04-05Log bans and unbansJune McEnroe 2020-04-05Parse mode types from ISUPPORTJune McEnroe 2020-04-05Add unscoop matchers for ban/unban eventsJune McEnroe 2020-04-05Check unscoop regexps with make testJune McEnroe 2020-04-05Add unscoop -n flag for checking regexpsJune McEnroe 2020-04-05Add Ban and Unban event typesJune McEnroe 2020-04-02Update styleJune McEnroe 2020-03-31Update unscoop catgirl matchersJune McEnroe 2020-03-31Fix writing verbose to stderrJune McEnroe 2020-03-02Include <>/-/* around nicks in scoop coloring 1.1June McEnroe 2020-03-02Replace .mk files with configure scriptJune McEnroe 2020-02-28Implement the causal.agency/consumer capabilityJune McEnroe 2020-02-22Include <>/-/* around nicks in coloringJune McEnroe 2020-02-22Use (almost) the full range of IRC colors for nicksJune McEnroe