about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-04-16 16:37:47 -0400
committerJune McEnroe <june@causal.agency>2021-04-16 16:39:24 -0400
commitcfd5bf213cca412257c9bedf44bc99d1e51908c2 (patch)
treeb6e8a856b15cb711263279685154574ade5df284
parentAlways show 341 RPL_INVITING (diff)
downloadcatgirl-cfd5bf213cca412257c9bedf44bc99d1e51908c2.tar.gz
catgirl-cfd5bf213cca412257c9bedf44bc99d1e51908c2.zip
Set id color from completion in /msg
In the same way that /query copies the id color from completion.
Also make both first check that a color isn't already set.
Diffstat (limited to '')
-rw-r--r--command.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/command.c b/command.c
index 0aefb2b..eae865e 100644
--- a/command.c
+++ b/command.c
@@ -135,8 +135,12 @@ static void commandMe(uint id, char *params) {
 }
 
 static void commandMsg(uint id, char *params) {
-	id = idFor(strsep(&params, " "));
-	splitMessage("PRIVMSG", id, params);
+	char *nick = strsep(&params, " ");
+	uint msg = idFor(nick);
+	if (idColors[msg] == Default) {
+		idColors[msg] = completeColor(id, nick);
+	}
+	splitMessage("PRIVMSG", msg, params);
 }
 
 static void commandJoin(uint id, char *params) {
@@ -357,7 +361,9 @@ static void commandCS(uint id, char *params) {
 static void commandQuery(uint id, char *params) {
 	if (!params) return;
 	uint query = idFor(params);
-	idColors[query] = completeColor(id, params);
+	if (idColors[query] == Default) {
+		idColors[query] = completeColor(id, params);
+	}
 	uiShowID(query);
 }
 
7c597be6c18e0467d&follow=1'>Generate Terminal.app color schemeJune McEnroe Colors still very much WIP, but coming along. 2018-03-31Generate basic ANSI color schemeJune McEnroe 2018-03-31Add hex output to schemeJune McEnroe 2018-03-31Add color scheme PNG generatorJune McEnroe 2018-03-31Simplify gfxx palette generationJune McEnroe 2018-03-31Switch to HSV for gfxx palette generationJune McEnroe 2018-03-30Generate default palette in gfxxJune McEnroe 2018-03-30Ignore build and cloneJune McEnroe 2018-03-30Set g:clipboard to pb{copy,paste} alwaysJune McEnroe Previously neovim would use these automatically if it found them, but now it only checks for them on macOS. pbd continues to work well. 2018-03-28Add d-_-b crateJune McEnroe