Browse Source

Add /raw command

June 1 week ago
parent
commit
9d7e0726c2
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
2 changed files with 20 additions and 0 deletions
  1. 7
    0
      catgirl.1
  2. 13
    0
      input.c

+ 7
- 0
catgirl.1 View File

@@ -171,6 +171,13 @@ The default
171 171
 is
172 172
 .Dq Goodbye .
173 173
 .
174
+.It Ic /raw Op Ar command
175
+Toggle the
176
+.Ql -raw-
177
+view
178
+and send the raw IRC
179
+.Ar command .
180
+.
174 181
 .It Ic /topic Op Ar topic
175 182
 Show the topic of the current channel
176 183
 or set it to

+ 13
- 0
input.c View File

@@ -49,6 +49,18 @@ param(struct Tag tag, const char *command, char **params, const char *name) {
49 49
 
50 50
 typedef void (*Handler)(struct Tag tag, char *params);
51 51
 
52
+static void inputRaw(struct Tag tag, char *params) {
53
+	(void)tag;
54
+	if (!params || !self.raw) {
55
+		self.raw ^= true;
56
+		uiFmt(
57
+			TagRaw, UIWarm, "Raw view is %s",
58
+			self.raw ? "enabled" : "disabled"
59
+		);
60
+	}
61
+	if (params) ircFmt("%s\r\n", params);
62
+}
63
+
52 64
 static void inputMe(struct Tag tag, char *params) {
53 65
 	privmsg(tag, true, params ? params : "");
54 66
 }
@@ -168,6 +180,7 @@ static const struct {
168 180
 	{ "/part", inputPart },
169 181
 	{ "/query", inputQuery },
170 182
 	{ "/quit", inputQuit },
183
+	{ "/raw", inputRaw },
171 184
 	{ "/topic", inputTopic },
172 185
 	{ "/url", inputURL },
173 186
 	{ "/view", inputView },

Loading…
Cancel
Save