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.
master
C. McEnroe 2021-04-16 16:37:47 -04:00
parent 63bffae8c1
commit cfd5bf213c
1 changed files with 9 additions and 3 deletions

View File

@ -135,8 +135,12 @@ static void commandMe(uint id, char *params) {
} }
static void commandMsg(uint id, char *params) { static void commandMsg(uint id, char *params) {
id = idFor(strsep(&params, " ")); char *nick = strsep(&params, " ");
splitMessage("PRIVMSG", id, 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) { 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) { static void commandQuery(uint id, char *params) {
if (!params) return; if (!params) return;
uint query = idFor(params); uint query = idFor(params);
if (idColors[query] == Default) {
idColors[query] = completeColor(id, params); idColors[query] = completeColor(id, params);
}
uiShowID(query); uiShowID(query);
} }