diff options
| author | C. McEnroe | 2021-04-16 16:37:47 -0400 | 
|---|---|---|
| committer | C. McEnroe | 2021-04-16 16:39:24 -0400 | 
| commit | cfd5bf213cca412257c9bedf44bc99d1e51908c2 (patch) | |
| tree | b6e8a856b15cb711263279685154574ade5df284 | |
| parent | 63bffae8c1db1e1e083ae3e30ef4566e9e3e36ca (diff) | |
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.
| -rw-r--r-- | command.c | 12 | 
1 files changed, 9 insertions, 3 deletions
| @@ -135,8 +135,12 @@ static void commandMe(uint id, char *params) {  }  static void commandMsg(uint id, char *params) { -	id = idFor(strsep(¶ms, " ")); -	splitMessage("PRIVMSG", id, params); +	char *nick = strsep(¶ms, " "); +	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);  } | 
