about summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-03 19:17:29 -0400
committerJune McEnroe <june@causal.agency>2018-08-03 19:17:29 -0400
commit674e527b33afb1cd8eca3edd65addc0550fcb4b1 (patch)
treea3d86072a2e0482da4e4f99f3c0da16f92b424f9 /chat.c
parentUse more octal char literals (diff)
downloadtest-674e527b33afb1cd8eca3edd65addc0550fcb4b1.tar.gz
test-674e527b33afb1cd8eca3edd65addc0550fcb4b1.zip
Handle ACTIONs
Diffstat (limited to 'chat.c')
-rw-r--r--chat.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/chat.c b/chat.c
index c368212..497c051 100644
--- a/chat.c
+++ b/chat.c
@@ -333,7 +333,12 @@ static void handlePrivmsg(char *prefix, char *params) {
 	char *user = prift(&prefix);
 	shift(&params);
 	char *mesg = shift(&params);
-	uiFmt("<\3%d%s\3> %s", color(user), nick, mesg);
+	if (mesg[0] == '\1') {
+		strsep(&mesg, " ");
+		uiFmt("* \3%d%s\3 %s", color(user), nick, strsep(&mesg, "\1"));
+	} else {
+		uiFmt("<\3%d%s\3> %s", color(user), nick, mesg);
+	}
 }
 static void handleNotice(char *prefix, char *params) {
 	char *nick = prift(&prefix);
@@ -423,7 +428,10 @@ static void webirc(const char *pass) {
 	const char *ssh = getenv("SSH_CLIENT");
 	if (!ssh) return;
 	int len = strchrnul(ssh, ' ') - ssh;
-	clientFmt("WEBIRC %s %s %.*s %.*s\r\n", pass, client.nick, len, ssh, len, ssh);
+	clientFmt(
+		"WEBIRC %s %s %.*s %.*s\r\n",
+		pass, client.nick, len, ssh, len, ssh
+	);
 }
 
 int main(int argc, char *argv[]) {
-12-19 15:42:21 -0500'>2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe Hack: output an extra <td> after rendering mdoc so that line numbers can be hidden based on there being three. This required splitting source-filter and about-filter since on about pages there is no table. 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe :target persists after you click on something else. 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe NULs in the input cause an infinite loop in htmlEscape, not to mention regexes obviously not working, etc. 2019-12-16Post "cgit setup"June McEnroe