Changeset 64768d4 for protocols/msn/msn_util.c
- Timestamp:
- 2010-09-02T09:15:44Z (14 years ago)
- Branches:
- master
- Children:
- bae0617
- Parents:
- 02bb9db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn_util.c
r02bb9db r64768d4 30 30 #include <ctype.h> 31 31 32 int msn_write( struct im_connection *ic, char *s, int len )33 {34 struct msn_data *md = ic->proto_data;35 int st;36 37 if( getenv( "BITLBEE_DEBUG" ) )38 {39 write( 2, "->NS:", 5 );40 write( 2, s, len );41 }42 43 st = write( md->fd, s, len );44 if( st != len )45 {46 imcb_error( ic, "Short write() to main server" );47 imc_logout( ic, TRUE );48 return 0;49 }50 51 return 1;52 }53 54 32 int msn_logged_in( struct im_connection *ic ) 55 33 { … … 76 54 { 77 55 struct msn_data *md = ic->proto_data; 78 char buf[1024],groupid[8];56 char groupid[8]; 79 57 bee_user_t *bu; 80 58 struct msn_buddy_data *bd; … … 144 122 if( ( adl = adlrml_entry( who, list ) ) ) 145 123 { 146 g_snprintf( buf, sizeof( buf ), "ADL %d %zd\r\n%s",147 ++md->trId, strlen( adl ), adl );124 int st = msn_ns_write( ic, -1, "ADL %d %zd\r\n%s", 125 ++md->trId, strlen( adl ), adl ); 148 126 g_free( adl ); 149 127 150 return msn_write( ic, buf, strlen( buf ) );128 return st; 151 129 } 152 130 … … 157 135 { 158 136 struct msn_data *md = ic->proto_data; 159 char buf[1024],groupid[8];137 char groupid[8]; 160 138 bee_user_t *bu; 161 139 struct msn_buddy_data *bd; … … 189 167 if( ( adl = adlrml_entry( who, list ) ) ) 190 168 { 191 g_snprintf( buf, sizeof( buf ), "RML %d %zd\r\n%s",192 ++md->trId, strlen( adl ), adl );169 int st = msn_ns_write( ic, -1, "RML %d %zd\r\n%s", 170 ++md->trId, strlen( adl ), adl ); 193 171 g_free( adl ); 194 172 195 return msn_write( ic, buf, strlen( buf ) );173 return st; 196 174 } 197 175 … … 603 581 struct msn_data *md = ic->proto_data; 604 582 char fn[strlen(value)*3+1]; 605 char buf[512];606 583 607 584 strcpy( fn, value ); 608 585 http_encode( fn ); 609 g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n",610 ++md->trId, fn );611 586 612 587 /* Note: We don't actually know if the server accepted the new name, 613 588 and won't give proper feedback yet if it doesn't. */ 614 return msn_ write( ic, buf, strlen( buf ));615 } 589 return msn_ns_write( ic, -1, "PRP %d MFN %s\r\n", ++md->trId, fn ); 590 }
Note: See TracChangeset
for help on using the changeset viewer.