From 5d7dc007a418be0c897000e888e747047729c756 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 2 Jul 2007 22:24:04 +0100 Subject: Stripping of unwanted characters (@ and =) in channel nicknames. --- protocols/jabber/conference.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index d236f0bb..24b5631a 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -150,13 +150,23 @@ void jabber_chat_pkt_presence( struct im_connection *ic, struct jabber_buddy *bu if( bud->ext_jid == NULL ) { if( bud == jc->me ) + { bud->ext_jid = jabber_normalize( ic->acc->user ); + } else + { + int i; + /* Don't want the nick to be at the end, so let's think of some slightly different notation to use for anonymous groupchat participants in BitlBee. */ bud->ext_jid = g_strdup_printf( "%s=%s", bud->resource, bud->bare_jid ); - + + /* And strip any unwanted characters. */ + for( i = 0; bud->resource[i]; i ++ ) + if( bud->ext_jid[i] == '=' || bud->ext_jid[i] == '@' ) + bud->ext_jid[i] = '_'; + } bud->flags |= JBFLAG_IS_ANONYMOUS; } -- cgit v1.2.3