Changeset 0da65d5 for protocols/msn/sb.c


Ignore:
Timestamp:
2007-03-31T05:40:45Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aef4828
Parents:
fa29d093
Message:

s/gaim_connection/im_connection/ and some other minor API changes. The rest
will come tomorrow. It compiles, I'll leave the real testing up to someone
else. ;-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    rfa29d093 r0da65d5  
    4848}
    4949
    50 struct msn_switchboard *msn_sb_create( struct gaim_connection *gc, char *host, int port, char *key, int session )
    51 {
    52         struct msn_data *md = gc->proto_data;
     50struct msn_switchboard *msn_sb_create( struct im_connection *ic, char *host, int port, char *key, int session )
     51{
     52        struct msn_data *md = ic->proto_data;
    5353        struct msn_switchboard *sb = g_new0( struct msn_switchboard, 1 );
    5454       
     
    6060        }
    6161       
    62         sb->gc = gc;
     62        sb->ic = ic;
    6363        sb->key = g_strdup( key );
    6464        sb->session = session;
     
    7070}
    7171
    72 struct msn_switchboard *msn_sb_by_handle( struct gaim_connection *gc, char *handle )
    73 {
    74         struct msn_data *md = gc->proto_data;
     72struct msn_switchboard *msn_sb_by_handle( struct im_connection *ic, char *handle )
     73{
     74        struct msn_data *md = ic->proto_data;
    7575        struct msn_switchboard *sb;
    7676        GSList *l;
     
    8686}
    8787
    88 struct msn_switchboard *msn_sb_by_chat( struct conversation *c )
    89 {
    90         struct msn_data *md = c->gc->proto_data;
     88struct msn_switchboard *msn_sb_by_chat( struct groupchat *c )
     89{
     90        struct msn_data *md = c->ic->proto_data;
    9191        struct msn_switchboard *sb;
    9292        GSList *l;
     
    102102}
    103103
    104 struct msn_switchboard *msn_sb_spare( struct gaim_connection *gc )
    105 {
    106         struct msn_data *md = gc->proto_data;
     104struct msn_switchboard *msn_sb_spare( struct im_connection *ic )
     105{
     106        struct msn_data *md = ic->proto_data;
    107107        struct msn_switchboard *sb;
    108108        GSList *l;
     
    142142                else
    143143                {
    144                         i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username );
     144                        i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->ic->username );
    145145                        buf = g_new0( char, i );
    146                         i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->gc->username );
     146                        i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->username );
    147147                }
    148148               
     
    177177}
    178178
    179 struct conversation *msn_sb_to_chat( struct msn_switchboard *sb )
    180 {
    181         struct gaim_connection *gc = sb->gc;
     179struct groupchat *msn_sb_to_chat( struct msn_switchboard *sb )
     180{
     181        struct im_connection *ic = sb->ic;
    182182        char buf[1024];
    183183       
    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, buf );
     186        sb->chat = serv_got_joined_chat( ic, buf );
    187187       
    188188        /* Populate the channel. */
    189189        if( sb->who ) add_chat_buddy( sb->chat, sb->who );
    190         add_chat_buddy( sb->chat, gc->username );
     190        add_chat_buddy( sb->chat, ic->username );
    191191       
    192192        /* And make sure the switchboard doesn't look like a regular chat anymore. */
     
    202202void msn_sb_destroy( struct msn_switchboard *sb )
    203203{
    204         struct gaim_connection *gc = sb->gc;
    205         struct msn_data *md = gc->proto_data;
     204        struct im_connection *ic = sb->ic;
     205        struct msn_data *md = ic->proto_data;
    206206       
    207207        debug( "Destroying switchboard: %s", sb->who ? sb->who : sb->key ? sb->key : "" );
     
    222222                g_slist_free( sb->msgq );
    223223               
    224                 serv_got_crap( gc, "Warning: Closing down MSN switchboard connection with "
     224                serv_got_crap( ic, "Warning: Closing down MSN switchboard connection with "
    225225                                   "unsent message to %s, you'll have to resend it.",
    226226                                   sb->who ? sb->who : "(unknown)" );
     
    253253{
    254254        struct msn_switchboard *sb = data;
    255         struct gaim_connection *gc;
     255        struct im_connection *ic;
    256256        struct msn_data *md;
    257257        char buf[1024];
     
    261261                return FALSE;
    262262       
    263         gc = sb->gc;
    264         md = gc->proto_data;
     263        ic = sb->ic;
     264        md = ic->proto_data;
    265265       
    266266        if( source != sb->fd )
     
    280280       
    281281        if( sb->session == MSN_SB_NEW )
    282                 g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, gc->username, sb->key );
     282                g_snprintf( buf, sizeof( buf ), "USR %d %s %s\r\n", ++sb->trId, ic->username, sb->key );
    283283        else
    284                 g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, gc->username, sb->key, sb->session );
     284                g_snprintf( buf, sizeof( buf ), "ANS %d %s %s %d\r\n", ++sb->trId, ic->username, sb->key, sb->session );
    285285       
    286286        if( msn_sb_write( sb, buf, strlen( buf ) ) )
     
    310310{
    311311        struct msn_switchboard *sb = data;
    312         struct gaim_connection *gc = sb->gc;
     312        struct im_connection *ic = sb->ic;
    313313        char buf[1024];
    314314       
     
    321321        if( strcmp( cmd[0], "XFR" ) == 0 )
    322322        {
    323                 hide_login_progress_error( gc, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
    324                 signoff( gc );
     323                hide_login_progress_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
     324                signoff( ic );
    325325                return( 0 );
    326326        }
     
    374374                        {
    375375                                g_snprintf( buf, sizeof( buf ), "MSN groupchat session %d", sb->session );
    376                                 sb->chat = serv_got_joined_chat( gc, buf );
     376                                sb->chat = serv_got_joined_chat( ic, buf );
    377377                               
    378378                                g_free( sb->who );
     
    384384                        if( num == tot )
    385385                        {
    386                                 add_chat_buddy( sb->chat, gc->username );
     386                                add_chat_buddy( sb->chat, ic->username );
    387387                        }
    388388                }
     
    529529               
    530530                g_snprintf( buf, sizeof( buf ), "Error reported by switchboard server: %s", err->text );
    531                 do_error_dialog( gc, buf, "MSN" );
     531                do_error_dialog( ic, buf, "MSN" );
    532532               
    533533                if( err->flags & STATUS_SB_FATAL )
     
    538538                else if( err->flags & STATUS_FATAL )
    539539                {
    540                         signoff( gc );
     540                        signoff( ic );
    541541                        return 0;
    542542                }
     
    579579{
    580580        struct msn_switchboard *sb = data;
    581         struct gaim_connection *gc = sb->gc;
     581        struct im_connection *ic = sb->ic;
    582582        char *body;
    583583        int blen = 0;
     
    608608                        if( sb->who )
    609609                        {
    610                                 serv_got_im( gc, cmd[1], body, 0, 0, blen );
     610                                serv_got_im( ic, cmd[1], body, 0, 0, blen );
    611611                        }
    612612                        else if( sb->chat )
     
    667667                        if( sb->who )
    668668                        {
    669                                 serv_got_im( gc, cmd[1], buf, 0, 0, strlen( buf ) );
     669                                serv_got_im( ic, cmd[1], buf, 0, 0, strlen( buf ) );
    670670                        }
    671671                        else if( sb->chat )
     
    684684                        if( who )
    685685                        {
    686                                 serv_got_typing( gc, who, 5, 1 );
     686                                serv_got_typing( ic, who, 5, 1 );
    687687                                g_free( who );
    688688                        }
Note: See TracChangeset for help on using the changeset viewer.