From cbd163aa5a8b0c3fad97fc07a0524307ce98e31e Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 15 May 2011 21:13:12 +0000 Subject: [PATCH] Accept names replies with nick!user@host instead of nick if they are somehow enabled (UHNAMES/userhost-in-names). bug #805 git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5205 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-nicklist.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index f16bd870..8a9ab1ec 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -103,7 +103,7 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data) { IRC_CHANNEL_REC *chanrec; NICK_REC *rec; - char *params, *type, *channel, *names, *ptr; + char *params, *type, *channel, *names, *ptr, *host; int op, halfop, voice; char prefixes[MAX_USER_PREFIXES+1]; @@ -162,9 +162,15 @@ static void event_names_list(IRC_SERVER_REC *server, const char *data) ptr++; } + host = strchr(ptr, '!'); + if (host != NULL) + *host++ = '\0'; + if (nicklist_find((CHANNEL_REC *) chanrec, ptr) == NULL) { rec = irc_nicklist_insert(chanrec, ptr, op, halfop, voice, FALSE, prefixes); + if (host != NULL) + nicklist_set_host(CHANNEL(chanrec), rec, host); } }