summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-01-29 14:02:40 -0500
committerPatrick Griffis <tingping@tingping.se>2016-01-29 15:28:33 -0500
commit8da205b0a86c94fabb543ad7f8b37feff2b27842 (patch)
tree732ed82812719bae467cef817c3881beb9d0858f
parent981d55e84c417095c0f686a6e22ba83ef9aa4b4e (diff)
Add support for chghost
-rw-r--r--src/common/inbound.c1
-rw-r--r--src/common/proto-irc.c7
-rw-r--r--src/common/userlist.c3
3 files changed, 9 insertions, 2 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 0d24532f..7dc332b3 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -1725,6 +1725,7 @@ static const char * const supported_caps[] = {
 	"server-time",
 	"userhost-in-names",
 	"cap-notify",
+	"chghost",
 
 	/* ZNC */
 	"znc.in/server-time-iso",
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 4174e182..180a3e43 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1147,7 +1147,12 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
 		case WORDL('A', 'U', 'T', 'H'):
 			inbound_sasl_authenticate (sess->server, word_eol[3]);
 			return;
-			
+
+		case WORDL('C', 'H', 'G', 'H'):
+			inbound_user_info (sess, NULL, word[3], word[4], NULL, nick, NULL,
+							   NULL, 0xff, tags_data);
+			return;
+
 		case WORDL('I','N','V','I'):
 			if (ignore_check (word[1], IG_INVI))
 				return;
diff --git a/src/common/userlist.c b/src/common/userlist.c
index 54ed6f03..da40ff14 100644
--- a/src/common/userlist.c
+++ b/src/common/userlist.c
@@ -123,10 +123,11 @@ userlist_add_hostname (struct session *sess, char *nick, char *hostname,
 	user = userlist_find (sess, nick);
 	if (user)
 	{
-		if (!user->hostname && hostname)
+		if (hostname && (!user->hostname || strcmp(user->hostname, hostname)))
 		{
 			if (prefs.hex_gui_ulist_show_hosts)
 				do_rehash = TRUE;
+			g_free (user->hostname);
 			user->hostname = g_strdup (hostname);
 		}
 		if (!user->realname && realname && *realname)