diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2013-07-01 23:43:02 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2013-07-01 23:43:02 +0100 |
commit | c92ee728d0d3741ce9094b076bf12a5a2e0e3c66 (patch) | |
tree | 4dc0e155146a89fa05c5d036a76e7104f7b25b4f /irc_im.c | |
parent | ea166fee8cba5a254bbd46f4631f6c3fababc9f0 (diff) |
Use account tag instead of protocol/network name for generating hostmasks.
Diffstat (limited to 'irc_im.c')
-rw-r--r-- | irc_im.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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, ' ' ) ) ) |