diff --git a/protocols/jabber/conference.c b/protocols/jabber/conference.c index 480006b..e0345bd 100644 --- a/protocols/jabber/conference.c +++ b/protocols/jabber/conference.c @@ -61,7 +61,7 @@ struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, of the nick to send a proper presence update. */ jc->my_full_jid = roomjid; - c = imcb_chat_new( ic, room ); + c = imcb_chat_new( ic, room, 0 ); c->data = jc; return c; diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index e952623..415c1bc 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -225,7 +225,7 @@ struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb ) /* Create the groupchat structure. */ g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); - sb->chat = imcb_chat_new( ic, buf ); + sb->chat = imcb_chat_new( ic, buf, 0 ); /* Populate the channel. */ if( sb->who ) imcb_chat_add_buddy( sb->chat, sb->who ); @@ -440,7 +440,7 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts ) if( num == 1 ) { g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session ); - sb->chat = imcb_chat_new( ic, buf ); + sb->chat = imcb_chat_new( ic, buf, 0 ); g_free( sb->who ); sb->who = NULL; diff --git a/protocols/nogaim.c b/protocols/nogaim.c index fd44532..857dd92 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -712,7 +712,7 @@ void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags ) } } -struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) +struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle, int handle_is_channame ) { struct groupchat *c; @@ -728,7 +728,10 @@ struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ) c->ic = ic; c->title = g_strdup( handle ); - c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ ); + if( !handle_is_channame ) + c->channel = g_strdup_printf( "&chat_%03d", ic->irc->c_id++ ); + else + c->channel = g_strdup_printf( "&%s", handle ); c->topic = g_strdup_printf( "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", c->title ); if( set_getbool( &ic->irc->set, "debug" ) ) diff --git a/protocols/nogaim.h b/protocols/nogaim.h index ddfff07..25baaf3 100644 --- a/protocols/nogaim.h +++ b/protocols/nogaim.h @@ -289,7 +289,7 @@ G_MODULE_EXPORT void imcb_chat_invited( struct im_connection *ic, char *handle, * - After you have a groupchat pointer, you should add the handles, finally * the user her/himself. At that point the group chat will be visible to the * user, too. */ -G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle ); +G_MODULE_EXPORT struct groupchat *imcb_chat_new( struct im_connection *ic, const char *handle, int handle_is_channame ); G_MODULE_EXPORT void imcb_chat_add_buddy( struct groupchat *b, char *handle ); /* To remove a handle from a group chat. Reason can be NULL. */ G_MODULE_EXPORT void imcb_chat_remove_buddy( struct groupchat *b, char *handle, char *reason ); diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 1118c26..056e5f4 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -792,7 +792,7 @@ static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) { chatcon = find_oscar_chat_by_conn(ic, fr->conn); chatcon->id = id; - chatcon->cnv = imcb_chat_new(ic, chatcon->show); + chatcon->cnv = imcb_chat_new(ic, chatcon->show, 0); chatcon->cnv->data = chatcon; return 1; diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c index 3e844c5..0e7ec83 100644 --- a/protocols/yahoo/yahoo.c +++ b/protocols/yahoo/yahoo.c @@ -332,7 +332,7 @@ static struct groupchat *byahoo_chat_with( struct im_connection *ic, char *who ) roomname = g_strdup_printf( "%s-Bee-%d", ic->acc->user, byahoo_chat_id ); - c = imcb_chat_new( ic, roomname ); + c = imcb_chat_new( ic, roomname, 0 ); imcb_chat_add_buddy( c, ic->acc->user ); /* FIXME: Free this thing when the chat's destroyed. We can't *always* @@ -831,7 +831,7 @@ void ext_yahoo_got_conf_invite( int id, const char *ignored, inv = g_malloc( sizeof( struct byahoo_conf_invitation ) ); memset( inv, 0, sizeof( struct byahoo_conf_invitation ) ); inv->name = g_strdup( room ); - inv->c = imcb_chat_new( ic, (char*) room ); + inv->c = imcb_chat_new( ic, (char*) room, 0 ); inv->c->data = members; inv->yid = id; inv->members = members;