aboutsummaryrefslogtreecommitdiffstats
path: root/irc_im.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-11-21 15:53:08 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-11-21 15:53:08 +0000
commit495d21b4d09392a84ff4c6fd914a0923029d2462 (patch)
treef764f6f53f354220bceba7461c7f21c8d2c90a5f /irc_im.c
parent748bcdde269da5cd8184418f0df334e12338a541 (diff)
Chop spaces from IM handles in all cases. Fixes #723.
Diffstat (limited to 'irc_im.c')
-rw-r--r--irc_im.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/irc_im.c b/irc_im.c
index 4e847d35..eb8d01f2 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -64,22 +64,18 @@ static gboolean bee_irc_user_new( bee_t *bee, bee_user_t *bu )
iu->host = g_strdup( s + 1 );
iu->user = g_strndup( bu->handle, s - bu->handle );
}
- else if( bu->ic->acc->server )
- {
- iu->host = g_strdup( bu->ic->acc->server );
- iu->user = g_strdup( bu->handle );
-
- /* s/ /_/ ... important for AOL screennames */
- for( s = iu->user; *s; s ++ )
- if( *s == ' ' )
- *s = '_';
- }
else
{
- iu->host = g_strdup( bu->ic->acc->prpl->name );
iu->user = g_strdup( bu->handle );
+ if( bu->ic->acc->server )
+ iu->host = g_strdup( bu->ic->acc->server );
+ else
+ iu->host = g_strdup( bu->ic->acc->prpl->name );
}
+ while( ( s = strchr( iu->user, ' ' ) ) )
+ *s = '_';
+
if( bu->flags & BEE_USER_LOCAL )
{
char *s = set_getstr( &bee->set, "handle_unknown" );