Changeset fa29d093 for protocols/msn


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

Preparing for Jabber conference room support.

Location:
protocols/msn
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r723e611 rfa29d093  
    241241}
    242242
    243 static int msn_chat_send( struct gaim_connection *gc, int id, char *message )
    244 {
    245         struct msn_switchboard *sb = msn_sb_by_id( gc, id );
     243static int msn_chat_send( struct conversation *c, char *message )
     244{
     245        struct msn_switchboard *sb = msn_sb_by_chat( c );
    246246       
    247247        if( sb )
     
    251251}
    252252
    253 static void msn_chat_invite( struct gaim_connection *gc, int id, char *msg, char *who )
    254 {
    255         struct msn_switchboard *sb = msn_sb_by_id( gc, id );
     253static void msn_chat_invite( struct conversation *c, char *msg, char *who )
     254{
     255        struct msn_switchboard *sb = msn_sb_by_chat( c );
    256256        char buf[1024];
    257257       
     
    263263}
    264264
    265 static void msn_chat_leave( struct gaim_connection *gc, int id )
    266 {
    267         struct msn_switchboard *sb = msn_sb_by_id( gc, id );
     265static void msn_chat_leave( struct conversation *c )
     266{
     267        struct msn_switchboard *sb = msn_sb_by_chat( c );
    268268       
    269269        if( sb )
     
    271271}
    272272
    273 static int msn_chat_open( struct gaim_connection *gc, char *who )
     273static struct conversation *msn_chat_open( struct gaim_connection *gc, char *who )
    274274{
    275275        struct msn_switchboard *sb;
     
    280280        {
    281281                debug( "Converting existing switchboard to %s to a groupchat", who );
    282                 msn_sb_to_chat( sb );
    283                 return( 1 );
     282                return msn_sb_to_chat( sb );
    284283        }
    285284        else
     
    292291                        g_snprintf( buf, sizeof( buf ), "CAL %d %s\r\n", ++sb->trId, who );
    293292                        if( msn_sb_write( sb, buf, strlen( buf ) ) )
    294                         {
    295                                 msn_sb_to_chat( sb );
    296                                 return( 1 );
    297                         }
     293                                return msn_sb_to_chat( sb );
    298294                }
    299295               
     
    314310                md->msgq = g_slist_append( md->msgq, m );
    315311               
    316                 return( 1 );
    317         }
    318        
    319         return( 0 );
     312                /* FIXME: Can I try to return something here already? */
     313                return NULL;
     314        }
     315       
     316        return NULL;
    320317}
    321318
  • protocols/msn/msn.h

    r723e611 rfa29d093  
    169169struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session );
    170170struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle );
    171 struct msn_switchboard *msn_sb_by_id( struct gaim_connection *gc, int id );
     171struct msn_switchboard *msn_sb_by_chat( struct conversation *c );
    172172struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc );
    173173int msn_sb_sendmessage( struct msn_switchboard *sb, char *text );
    174 void msn_sb_to_chat( struct msn_switchboard *sb );
     174struct conversation *msn_sb_to_chat( struct msn_switchboard *sb );
    175175void msn_sb_destroy( struct msn_switchboard *sb );
    176176gboolean msn_sb_connected( gpointer data, gint source, b_input_condition cond );
  • protocols/msn/sb.c

    r723e611 rfa29d093  
    8686}
    8787
    88 struct msn_switchboard *msn_sb_by_id( struct gaim_connection *gc, int id )
    89 {
    90         struct msn_data *md = gc->proto_data;
     88struct msn_switchboard *msn_sb_by_chat( struct conversation *c )
     89{
     90        struct msn_data *md = c->gc->proto_data;
    9191        struct msn_switchboard *sb;
    9292        GSList *l;
     
    9595        {
    9696                sb = l->data;
    97                 if( sb->chat && sb->chat->id == id )
     97                if( sb->chat == c )
    9898                        return( sb );
    9999        }
     
    177177}
    178178
    179 void msn_sb_to_chat( struct msn_switchboard *sb )
     179struct conversation *msn_sb_to_chat( struct msn_switchboard *sb )
    180180{
    181181        struct gaim_connection *gc = sb->gc;
     
    184184        /* Create the groupchat structure. */
    185185        g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
    186         sb->chat = serv_got_joined_chat( gc, ++msn_chat_id, buf );
     186        sb->chat = serv_got_joined_chat( gc, buf );
    187187       
    188188        /* Populate the channel. */
     
    196196                sb->who = NULL;
    197197        }
     198       
     199        return sb->chat;
    198200}
    199201
     
    230232        if( sb->chat )
    231233        {
    232                 serv_got_chat_left( gc, sb->chat->id );
     234                serv_got_chat_left( sb->chat );
    233235        }
    234236       
     
    372374                        {
    373375                                g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
    374                                 sb->chat = serv_got_joined_chat( gc, ++msn_chat_id, buf );
     376                                sb->chat = serv_got_joined_chat( gc, buf );
    375377                               
    376378                                g_free( sb->who );
     
    610612                        else if( sb->chat )
    611613                        {
    612                                 serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, body, 0 );
     614                                serv_got_chat_in( sb->chat, cmd[1], 0, body, 0 );
    613615                        }
    614616                        else
     
    669671                        else if( sb->chat )
    670672                        {
    671                                 serv_got_chat_in( gc, sb->chat->id, cmd[1], 0, buf, 0 );
     673                                serv_got_chat_in( sb->chat, cmd[1], 0, buf, 0 );
    672674                        }
    673675                        else
Note: See TracChangeset for help on using the changeset viewer.