Ignore:
Timestamp:
2007-03-28T05:53:11Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0da65d5
Parents:
723e611
Message:

Preparing for Jabber conference room support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo.c

    r723e611 rfa29d093  
    140140       
    141141        while( gc->conversations )
    142                 serv_got_chat_left( gc, gc->conversations->id );
     142                serv_got_chat_left( gc->conversations );
    143143       
    144144        for( l = yd->buddygroups; l; l = l->next )
     
    332332}
    333333
    334 static int byahoo_chat_send( struct gaim_connection *gc, int id, char *message )
    335 {
    336         struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data;
    337         struct conversation *c;
    338        
    339         for( c = gc->conversations; c && c->id != id; c = c->next );
    340 
     334static int byahoo_chat_send( struct conversation *c, char *message )
     335{
     336        struct byahoo_data *yd = (struct byahoo_data *) c->gc->proto_data;
     337       
    341338        yahoo_conference_message( yd->y2_id, NULL, c->data, c->title, message, 1 );
    342339       
     
    344341}
    345342
    346 static void byahoo_chat_invite( struct gaim_connection *gc, int id, char *msg, char *who )
    347 {
    348         struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data;
    349         struct conversation *c;
    350        
    351         for( c = gc->conversations; c && c->id != id; c = c->next );
     343static void byahoo_chat_invite( struct conversation *c, char *msg, char *who )
     344{
     345        struct byahoo_data *yd = (struct byahoo_data *) c->gc->proto_data;
    352346       
    353347        yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg );
    354348}
    355349
    356 static void byahoo_chat_leave( struct gaim_connection *gc, int id )
    357 {
    358         struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data;
    359         struct conversation *c;
    360        
    361         for( c = gc->conversations; c && c->id != id; c = c->next );
     350static void byahoo_chat_leave( struct conversation *c )
     351{
     352        struct byahoo_data *yd = (struct byahoo_data *) c->gc->proto_data;
    362353       
    363354        yahoo_conference_logoff( yd->y2_id, NULL, c->data, c->title );
    364         serv_got_chat_left( gc, c->id );
    365 }
    366 
    367 static int byahoo_chat_open( struct gaim_connection *gc, char *who )
     355        serv_got_chat_left( c );
     356}
     357
     358static struct conversation *byahoo_chat_open( struct gaim_connection *gc, char *who )
    368359{
    369360        struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data;
     
    375366        g_snprintf( roomname, strlen( gc->username ) + 16, "%s-Bee-%d", gc->username, byahoo_chat_id );
    376367       
    377         c = serv_got_joined_chat( gc, ++byahoo_chat_id, roomname );
     368        c = serv_got_joined_chat( gc, roomname );
    378369        add_chat_buddy( c, gc->username );
    379370       
     
    387378        g_free( roomname );
    388379       
    389         return( 1 );
     380        return c;
    390381}
    391382
     
    805796{
    806797        yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
    807         serv_got_chat_left( inv->gc, inv->c->id );
     798        serv_got_chat_left( inv->c );
    808799        g_free( inv->name );
    809800        g_free( inv );
     
    820811        memset( inv, 0, sizeof( struct byahoo_conf_invitation ) );
    821812        inv->name = g_strdup( room );
    822         inv->c = serv_got_joined_chat( gc, ++byahoo_chat_id, room );
     813        inv->c = serv_got_joined_chat( gc, room );
    823814        inv->c->data = members;
    824815        inv->yid = id;
     
    872863        for( c = gc->conversations; c && strcmp( c->title, room ) != 0; c = c->next );
    873864       
    874         serv_got_chat_in( gc, c ? c->id : 0, who, 0, m, 0 );
     865        if( c )
     866                serv_got_chat_in( c, who, 0, m, 0 );
    875867        g_free( m );
    876868}
Note: See TracChangeset for help on using the changeset viewer.