Browse Source

Rename verbose to raw

And change the format of the sticky tag names again.
June 5 days ago
parent
commit
2797ac8abf
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
7 changed files with 20 additions and 20 deletions
  1. 2
    2
      catgirl.1
  2. 1
    1
      chat.c
  3. 2
    2
      chat.h
  4. 2
    2
      input.c
  5. 4
    4
      irc.c
  6. 7
    7
      tag.c
  7. 2
    2
      ui.c

+ 2
- 2
catgirl.1 View File

@@ -86,7 +86,7 @@ the same as the nickname.
86 86
 .
87 87
 .It Fl v
88 88
 Show raw IRC protocol in the
89
-.Ql ~irc
89
+.Ql -raw-
90 90
 view.
91 91
 .
92 92
 .It Fl w Ar pass
@@ -202,7 +202,7 @@ Query information about a user.
202 202
 .Pp
203 203
 Additionally,
204 204
 messages entered in the
205
-.Ql ~irc
205
+.Ql -raw-
206 206
 view
207 207
 will be sent as raw IRC commands.
208 208
 .

+ 1
- 1
chat.c View File

@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
62 62
 			break; case 'p': self.port = dupe(optarg);
63 63
 			break; case 'r': self.real = dupe(optarg);
64 64
 			break; case 'u': self.user = dupe(optarg);
65
-			break; case 'v': self.verbose = true;
65
+			break; case 'v': self.raw = true;
66 66
 			break; case 'w': self.pass = dupe(optarg);
67 67
 			break; default:  return EX_USAGE;
68 68
 		}

+ 2
- 2
chat.h View File

@@ -42,7 +42,7 @@ struct {
42 42
 	char *user;
43 43
 	char *real;
44 44
 	char *join;
45
-	bool verbose;
45
+	bool raw;
46 46
 	bool notify;
47 47
 	bool quit;
48 48
 } self;
@@ -59,7 +59,7 @@ struct Tag {
59 59
 enum { TagsLen = 256 };
60 60
 const struct Tag TagNone;
61 61
 const struct Tag TagStatus;
62
-const struct Tag TagVerbose;
62
+const struct Tag TagRaw;
63 63
 struct Tag tagFind(const char *name);
64 64
 struct Tag tagFor(const char *name);
65 65
 

+ 2
- 2
input.c View File

@@ -25,7 +25,7 @@
25 25
 #include "chat.h"
26 26
 
27 27
 static void privmsg(struct Tag tag, bool action, const char *mesg) {
28
-	if (tag.id == TagStatus.id || tag.id == TagVerbose.id) return;
28
+	if (tag.id == TagStatus.id || tag.id == TagRaw.id) return;
29 29
 	char *line;
30 30
 	int send;
31 31
 	asprintf(
@@ -184,7 +184,7 @@ void input(struct Tag tag, char *input) {
184 184
 	}
185 185
 
186 186
 	if (!slash) {
187
-		if (tag.id == TagVerbose.id) {
187
+		if (tag.id == TagRaw.id) {
188 188
 			ircFmt("%s\r\n", input);
189 189
 		} else {
190 190
 			privmsg(tag, false, input);

+ 4
- 4
irc.c View File

@@ -110,8 +110,8 @@ void ircFmt(const char *format, ...) {
110 110
 	int len =  vasprintf(&buf, format, ap);
111 111
 	va_end(ap);
112 112
 	if (!buf) err(EX_OSERR, "vasprintf");
113
-	if (self.verbose) {
114
-		uiFmt(TagVerbose, UICold, "\3%d<<<\3 %.*s", IRCWhite, len - 2, buf);
113
+	if (self.raw) {
114
+		uiFmt(TagRaw, UICold, "\3%d<<<\3 %.*s", IRCWhite, len - 2, buf);
115 115
 	}
116 116
 	ircWrite(buf, len);
117 117
 	free(buf);
@@ -133,8 +133,8 @@ retry:
133 133
 	char *line = buf;
134 134
 	while (NULL != (crlf = strnstr(line, "\r\n", &buf[len] - line))) {
135 135
 		crlf[0] = '\0';
136
-		if (self.verbose) {
137
-			uiFmt(TagVerbose, UICold, "\3%d>>>\3 %s", IRCGray, line);
136
+		if (self.raw) {
137
+			uiFmt(TagRaw, UICold, "\3%d>>>\3 %s", IRCGray, line);
138 138
 		}
139 139
 		handle(line);
140 140
 		line = &crlf[2];

+ 7
- 7
tag.c View File

@@ -21,19 +21,19 @@
21 21
 
22 22
 #include "chat.h"
23 23
 
24
-#define NONE    ""
25
-#define STATUS  "~status"
26
-#define VERBOSE "~irc"
24
+#define NONE   "-none-"
25
+#define STATUS "-status-"
26
+#define RAW    "-raw-"
27 27
 
28
-const struct Tag TagNone    = { 0, NONE };
29
-const struct Tag TagStatus  = { 1, STATUS };
30
-const struct Tag TagVerbose = { 2, VERBOSE };
28
+const struct Tag TagNone   = { 0, NONE };
29
+const struct Tag TagStatus = { 1, STATUS };
30
+const struct Tag TagRaw    = { 2, RAW };
31 31
 
32 32
 static struct {
33 33
 	char *name[TagsLen];
34 34
 	size_t len;
35 35
 } tags = {
36
-	.name = { NONE, STATUS, VERBOSE },
36
+	.name = { NONE, STATUS, RAW },
37 37
 	.len = 3,
38 38
 };
39 39
 

+ 2
- 2
ui.c View File

@@ -509,13 +509,13 @@ static void keyChar(wchar_t ch) {
509 509
 }
510 510
 
511 511
 static bool isAction(struct Tag tag, const wchar_t *input) {
512
-	if (tag.id == TagStatus.id || tag.id == TagVerbose.id) return false;
512
+	if (tag.id == TagStatus.id || tag.id == TagRaw.id) return false;
513 513
 	return !wcsncasecmp(input, L"/me ", 4);
514 514
 }
515 515
 
516 516
 // FIXME: This duplicates logic from input.c for wcs.
517 517
 static bool isCommand(struct Tag tag, const wchar_t *input) {
518
-	if (tag.id == TagStatus.id || tag.id == TagVerbose.id) return true;
518
+	if (tag.id == TagStatus.id || tag.id == TagRaw.id) return true;
519 519
 	if (input[0] != L'/') return false;
520 520
 	const wchar_t *space = wcschr(&input[1], L' ');
521 521
 	const wchar_t *extra = wcschr(&input[1], L'/');

Loading…
Cancel
Save