aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/conference.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-07-02 22:24:04 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2007-07-02 22:24:04 +0100
commit5d7dc007a418be0c897000e888e747047729c756 (patch)
treef16572c66168a074252a61813cf6ceb7966e4487 /protocols/jabber/conference.c
parent1962ac169c14c7b24e276caac0976b8983496fd5 (diff)
Stripping of unwanted characters (@ and =) in channel nicknames.
Diffstat (limited to 'protocols/jabber/conference.c')
-rw-r--r--protocols/jabber/conference.c12
1 files changed, 11 insertions, 1 deletions
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;
}