aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2013-07-01 23:43:02 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2013-07-01 23:43:02 +0100
commitc92ee728d0d3741ce9094b076bf12a5a2e0e3c66 (patch)
tree4dc0e155146a89fa05c5d036a76e7104f7b25b4f /irc_im.c
parentea166fee8cba5a254bbd46f4631f6c3fababc9f0 (diff)
Use account tag instead of protocol/network name for generating hostmasks.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c12
1 files changed, 11 insertions, 1 deletions
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, ' ' ) ) )