From c92ee728d0d3741ce9094b076bf12a5a2e0e3c66 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 1 Jul 2013 23:43:02 +0100 Subject: Use account tag instead of protocol/network name for generating hostmasks. --- irc_im.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index bc1ce91d..940f93bd 100644 --- a/irc_im.c +++ b/irc_im.c @@ -70,7 +70,17 @@ static gboolean bee_irc_user_new( bee_t *bee, bee_user_t *bu ) if( bu->ic->acc->server ) iu->host = g_strdup( bu->ic->acc->server ); else - iu->host = g_strdup( bu->ic->acc->prpl->name ); + { + char *s; + for( s = bu->ic->acc->tag; isalnum( *s ); s ++ ); + /* Only use the tag if we got to the end of the string. + (So allow alphanumerics only. Hopefully not too + restrictive.) */ + if( *s ) + iu->host = g_strdup( bu->ic->acc->prpl->name ); + else + iu->host = g_strdup( bu->ic->acc->tag ); + } } while( ( s = strchr( iu->user, ' ' ) ) ) -- cgit v1.2.3