about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--litterbox.c1
-rw-r--r--scoop.c34
2 files changed, 15 insertions, 20 deletions
diff --git a/litterbox.c b/litterbox.c
index 5a88132..c3bc46e 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -313,6 +313,7 @@ static void querySearch(struct Message *msg) {
 		const char *message = (const char *)sqlite3_column_text(stmt, i++);
 		if (!target) target = "";
 		if (!message) message = "";
+		if (!strcmp(user, "*")) user = nick;
 
 		format("NOTICE %s :(%s) [%s] ", msg->nick, context, time);
 		switch (type) {
diff --git a/scoop.c b/scoop.c
index 992411c..3acc6b1 100644
--- a/scoop.c
+++ b/scoop.c
@@ -159,31 +159,25 @@ static void formatColor(bool group, struct Event e) {
 	printf("[%s] ", e.time);
 
 #define C(x) "\33[%dm" x "\33[m"
+	int c = color(strcmp(e.user, "*") ? e.user : e.nick);
 	switch (e.type) {
-		break; case Privmsg: printf(C("<%s>") " ", color(e.user), e.nick);
-		break; case Notice:  printf(C("-%s-") " ", color(e.user), e.nick);
-		break; case Action:  printf(C("* %s") " ", color(e.user), e.nick);
-		break; case Join: printf(C("%s") " joined", color(e.user), e.nick);
-		break; case Part: printf(C("%s") " parted: ", color(e.user), e.nick);
-		break; case Quit: printf(C("%s") " quit: ", color(e.user), e.nick);
-		break; case Kick: {
-			printf(C("%s") " kicked %s: ", color(e.user), e.nick, e.target);
-		}
+		break; case Privmsg: printf(C("<%s>") " ", c, e.nick);
+		break; case Notice:  printf(C("-%s-") " ", c, e.nick);
+		break; case Action:  printf(C("* %s") " ", c, e.nick);
+		break; case Join: printf(C("%s") " joined", c, e.nick);
+		break; case Part: printf(C("%s") " parted: ", c, e.nick);
+		break; case Quit: printf(C("%s") " quit: ", c, e.nick);
+		break; case Kick: printf(C("%s") " kicked %s: ", c, e.nick, e.target);
 		break; case Nick: {
 			printf(
-				C("%s") " changed nick to " C("%s") "\n",
-				color(e.user), e.nick, color(e.user), e.target
+				C("%s") " changed nick to " C("%s"),
+				c, e.nick,
+				(strcmp(e.user, "*") ? c : color(e.target)), e.target
 			);
 		}
-		break; case Topic: {
-			printf(C("%s") " set the topic: ", color(e.user), e.nick);
-		}
-		break; case Ban: {
-			printf(C("%s") " banned %s", color(e.user), e.nick, e.target);
-		}
-		break; case Unban: {
-			printf(C("%s") " unbanned %s", color(e.user), e.nick, e.target);
-		}
+		break; case Topic: printf(C("%s") " set the topic: ", c, e.nick);
+		break; case Ban:   printf(C("%s") " banned %s", c, e.nick, e.target);
+		break; case Unban: printf(C("%s") " unbanned %s", c, e.nick, e.target);
 	}
 #undef C
 
The remaining caps only generate new commands which can easily be filtered out when sending to clients so will be in the first pass of support. extended-join is probably safe to pass through unaltered, just causing extraneous parameters on JOIN commands, but maybe not. invite-notify reuses the INVITE command where the invited user is not self. 2019-11-09Maintain stateCaps and offer them to clientsJune McEnroe 2019-11-09Parse capabilitiesJune McEnroe The list that I've defined are the ones that I expect to be able to enable probably without any clients breaking... And of course server-time which pounce implements itself. 2019-11-09Avoid the reserved _A names with BIT macroJune McEnroe 2019-11-09Define macro for bit flag enumsJune McEnroe 2019-11-08Check that password is hashedJune McEnroe 2019-11-08Avoid calling getopt_long again after it returns -1June McEnroe On GNU, calling getopt_long again will reset optind back to the first non-option argument, which would cause an infinite loop of reading the same configurtion file forever. 2019-11-08Only change AWAY status for registered clientsJune McEnroe Turns out I did eventually fix this, because I may want to implement "passive clients" for logging or notification stuff, which wouldn't affect AWAY status either. 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe This might reduce the frequency of a client getting its own message back because it was behind in the ring when it sent it. 2019-11-06Use -l:filename in Linux.mkJune McEnroe 2019-11-06Fix compat.h for #defined strlcpyJune McEnroe 2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe 2019-11-06Document calico service configurationJune McEnroe 2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe 2019-11-06Document pounce service configurationJune McEnroe 2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe 2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe 2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe