Ignore:
Timestamp:
2010-09-02T09:15:44Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
bae0617
Parents:
02bb9db
Message:

Replace msn*write functions with saner versions that accept format strings.
Also preparing for additional temporary NS connections (auth token renewal).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r02bb9db r64768d4  
    154154        if( strcmp( who, "raw" ) == 0 )
    155155        {
    156                 msn_write( ic, message, strlen( message ) );
    157                 msn_write( ic, "\r\n", 2 );
     156                msn_ns_write( ic, -1, "%s\r\n", message );
    158157        }
    159158        else
     
    193192static void msn_set_away( struct im_connection *ic, char *state, char *message )
    194193{
    195         char buf[1024];
    196194        char *uux;
    197195        struct msn_data *md = ic->proto_data;
     
    202200                md->away_state = msn_away_state_list + 1;
    203201       
    204         g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
    205         if( !msn_write( ic, buf, strlen( buf ) ) )
     202        if( !msn_ns_write( ic, -1, "CHG %d %s\r\n", ++md->trId, md->away_state->code ) )
    206203                return;
    207204       
    208205        uux = g_markup_printf_escaped( "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia>"
    209206                                       "</Data>", message ? message : "" );
    210         g_snprintf( buf, sizeof( buf ), "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux );
    211         if( !msn_write( ic, buf, strlen( buf ) ) )
    212                 return;
     207        msn_ns_write( ic, -1, "UUX %d %zd\r\n%s", ++md->trId, strlen( uux ), uux );
     208        g_free( uux );
    213209}
    214210
     
    290286static void msn_keepalive( struct im_connection *ic )
    291287{
    292         msn_write( ic, "PNG\r\n", strlen( "PNG\r\n" ) );
     288        msn_ns_write( ic, -1, "PNG\r\n" );
    293289}
    294290
Note: See TracChangeset for help on using the changeset viewer.