summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-02 18:57:57 -0400
committerJune McEnroe <june@causal.agency>2019-07-02 18:57:57 -0400
commitfdbc6f2fda4e3d26989b540505a6b8a755c28c23 (patch)
tree2e95feee2d64b9a9a36b60ba44ba38d0c21be071
parentAdd -k option for joining with keys (diff)
downloadcatgirl-fdbc6f2fda4e3d26989b540505a6b8a755c28c23.tar.gz
catgirl-fdbc6f2fda4e3d26989b540505a6b8a755c28c23.zip
Split /raw and /quote
/quote is common in other IRC clients.
-rw-r--r--catgirl.12
-rw-r--r--input.c20
2 files changed, 13 insertions, 9 deletions
diff --git a/catgirl.1 b/catgirl.1
index 93ed604..95e3ecd 100644
--- a/catgirl.1
+++ b/catgirl.1
@@ -141,7 +141,7 @@ Open a private message view.
 .It Ic /quit Op Ar message
 Quit IRC.
 .
-.It Ic /raw Ar command
+.It Ic /quote Ar command
 Send a raw IRC command.
 .
 .It Ic /topic Op Ar topic
diff --git a/input.c b/input.c
index 024941d..77c57cc 100644
--- a/input.c
+++ b/input.c
@@ -83,6 +83,11 @@ static void inputQuit(struct Tag tag, char *params) {
 	ircQuit(params ? params : "Goodbye");
 }
 
+static void inputQuote(struct Tag tag, char *params) {
+	(void)tag;
+	if (params) ircFmt("%s\r\n", params);
+}
+
 static void inputTopic(struct Tag tag, char *params) {
 	if (params) {
 		ircFmt("TOPIC %s :%s\r\n", tag.name, params);
@@ -143,14 +148,12 @@ static void inputOpen(struct Tag tag, char *params) {
 
 static void inputRaw(struct Tag tag, char *params) {
 	(void)tag;
-	if (!self.raw || !params) {
-		self.raw ^= true;
-		uiFmt(
-			TagRaw, UIWarm, "%s window is %s",
-			TagRaw.name, (self.raw ? "enabled" : "disabled")
-		);
-	}
-	if (params) ircFmt("%s\r\n", params);
+	(void)params;
+	self.raw ^= true;
+	uiFmt(
+		TagRaw, UIWarm, "\3%d%s\3 %s raw mode!",
+		colorGen(self.user), self.nick, (self.raw ? "engages" : "disengages")
+	);
 }
 
 static void inputURL(struct Tag tag, char *params) {
@@ -195,6 +198,7 @@ static const struct {
 	{ "/part", inputPart },
 	{ "/query", inputQuery },
 	{ "/quit", inputQuit },
+	{ "/quote", inputQuote },
 	{ "/raw", inputRaw },
 	{ "/topic", inputTopic },
 	{ "/url", inputURL },