Deal with ~users in colorGen
parent
fe38982b43
commit
6223c9c8f8
5
color.c
5
color.c
|
@ -29,8 +29,9 @@ static uint32_t hashChar(uint32_t hash, char ch) {
|
||||||
enum IRCColor colorGen(const char *str) {
|
enum IRCColor colorGen(const char *str) {
|
||||||
if (!str) return IRCDefault;
|
if (!str) return IRCDefault;
|
||||||
uint32_t hash = 0;
|
uint32_t hash = 0;
|
||||||
for (; str[0]; ++str) {
|
if (*str == '~') str++;
|
||||||
hash = hashChar(hash, str[0]);
|
for (; *str; ++str) {
|
||||||
|
hash = hashChar(hash, *str);
|
||||||
}
|
}
|
||||||
while (IRCBlack == (hash & IRCLightGray)) {
|
while (IRCBlack == (hash & IRCLightGray)) {
|
||||||
hash = hashChar(hash, '\0');
|
hash = hashChar(hash, '\0');
|
||||||
|
|
5
handle.c
5
handle.c
|
@ -43,7 +43,7 @@ static void parse(
|
||||||
field = strsep(&prefix, "!");
|
field = strsep(&prefix, "!");
|
||||||
if (nick) *nick = field;
|
if (nick) *nick = field;
|
||||||
field = strsep(&prefix, "@");
|
field = strsep(&prefix, "@");
|
||||||
if (user) *user = (field && field[0] == '~' ? &field[1] : field);
|
if (user) *user = field;
|
||||||
if (host) *host = prefix;
|
if (host) *host = prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ static void handleReplyWhoisUser(char *prefix, char *params) {
|
||||||
prefix, NULL, NULL, NULL,
|
prefix, NULL, NULL, NULL,
|
||||||
params, 6, 0, NULL, &nick, &user, &host, NULL, &real
|
params, 6, 0, NULL, &nick, &user, &host, NULL, &real
|
||||||
);
|
);
|
||||||
whoisColor = colorGen(user[0] == '~' ? &user[1] : user);
|
whoisColor = colorGen(user);
|
||||||
uiFmt(
|
uiFmt(
|
||||||
TagStatus, UIWarm,
|
TagStatus, UIWarm,
|
||||||
"\3%d%s\3 is %s@%s, \"%s\"",
|
"\3%d%s\3 is %s@%s, \"%s\"",
|
||||||
|
@ -372,7 +372,6 @@ static void handleReplyWho(char *prefix, char *params) {
|
||||||
prefix, NULL, NULL, NULL,
|
prefix, NULL, NULL, NULL,
|
||||||
params, 6, 0, NULL, &chan, &user, NULL, NULL, &nick
|
params, 6, 0, NULL, &chan, &user, NULL, NULL, &nick
|
||||||
);
|
);
|
||||||
if (user[0] == '~') user = &user[1];
|
|
||||||
struct Tag tag = colorTag(tagFor(chan), chan);
|
struct Tag tag = colorTag(tagFor(chan), chan);
|
||||||
|
|
||||||
tabAdd(tag, nick);
|
tabAdd(tag, nick);
|
||||||
|
|
Loading…
Reference in New Issue