summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--color.c5
-rw-r--r--handle.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/color.c b/color.c
index f713451..dad5647 100644
--- a/color.c
+++ b/color.c
@@ -29,8 +29,9 @@ static uint32_t hashChar(uint32_t hash, char ch) {
 enum IRCColor colorGen(const char *str) {
 	if (!str) return IRCDefault;
 	uint32_t hash = 0;
-	for (; str[0]; ++str) {
-		hash = hashChar(hash, str[0]);
+	if (*str == '~') str++;
+	for (; *str; ++str) {
+		hash = hashChar(hash, *str);
 	}
 	while (IRCBlack == (hash & IRCLightGray)) {
 		hash = hashChar(hash, '\0');
diff --git a/handle.c b/handle.c
index 4f9015c..e59960b 100644
--- a/handle.c
+++ b/handle.c
@@ -43,7 +43,7 @@ static void parse(
 		field = strsep(&prefix, "!");
 		if (nick) *nick = field;
 		field = strsep(&prefix, "@");
-		if (user) *user = (field && field[0] == '~' ? &field[1] : field);
+		if (user) *user = field;
 		if (host) *host = prefix;
 	}
 
@@ -164,7 +164,7 @@ static void handleReplyWhoisUser(char *prefix, char *params) {
 		prefix, NULL, NULL, NULL,
 		params, 6, 0, NULL, &nick, &user, &host, NULL, &real
 	);
-	whoisColor = colorGen(user[0] == '~' ? &user[1] : user);
+	whoisColor = colorGen(user);
 	uiFmt(
 		TagStatus, UIWarm,
 		"\3%d%s\3 is %s@%s, \"%s\"",
@@ -372,7 +372,6 @@ static void handleReplyWho(char *prefix, char *params) {
 		prefix, NULL, NULL, NULL,
 		params, 6, 0, NULL, &chan, &user, NULL, NULL, &nick
 	);
-	if (user[0] == '~') user = &user[1];
 	struct Tag tag = colorTag(tagFor(chan), chan);
 
 	tabAdd(tag, nick);
cEnroe 2019-02-25Add color to tagsJune McEnroe 2019-02-25Remove tag X macros againJune McEnroe 2019-02-25Add M-a to switch to hot or unread windowJune McEnroe 2019-02-25Refactor uiReadJune McEnroe 2019-02-24Scroll by full pages with PageUp/PageDownJune McEnroe 2019-02-23Clarify /window documentationJune McEnroe 2019-02-23Use first word of params in input commandsJune McEnroe 2019-02-23Add C-n and C-p key bindings to switch windowsJune McEnroe 2019-02-23Change example command to join #ascii.town on freenodeJune McEnroe 2019-02-23Call def_prog_mode after termNoFlowJune McEnroe 2019-02-22Move IRC formatting reset to C-sJune McEnroe 2019-02-22Disable terminal flow controlJune McEnroe 2019-02-22Bind up and down arrows to scrollJune McEnroe 2019-02-22Remove topic TODOJune McEnroe 2019-02-22Add /znc commandJune McEnroe 2019-02-22Update status line after scrolling and term eventsJune McEnroe 2019-02-22Reorganize input.cJune McEnroe 2019-02-22Fix name of <raw> window in man pageJune McEnroe 2019-02-22Rename global tags with angle bracketsJune McEnroe 2019-02-22Show status window while connectingJune McEnroe 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe 2019-02-21Replace "view" with "window"June McEnroe 2019-02-21Remove ROT13June McEnroe 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe