Changes in / [e97827b:3ef6410]
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
re97827b r3ef6410 366 366 struct gaim_connection *gc = acc->gc; 367 367 struct msn_data *md; 368 char buf[1024], *fn ;368 char buf[1024], *fn, *s; 369 369 int i; 370 370 … … 381 381 } 382 382 383 fn = msn_http_encode( value ); 383 /* Of course we could use http_encode() here, but when we encode 384 every character, the server is less likely to complain about the 385 chosen name. However, the MSN server doesn't seem to like escaped 386 non-ASCII chars, so we keep those unescaped. */ 387 s = fn = g_new0( char, strlen( value ) * 3 + 1 ); 388 for( i = 0; value[i]; i ++ ) 389 if( value[i] & 128 ) 390 { 391 *s = value[i]; 392 s ++; 393 } 394 else 395 { 396 g_snprintf( s, 4, "%%%02X", value[i] ); 397 s += 3; 398 } 384 399 385 400 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn ); -
protocols/msn/msn.h
re97827b r3ef6410 157 157 char **msn_linesplit( char *line ); 158 158 int msn_handler( struct msn_handler_data *h ); 159 char *msn_http_encode( const char *input );160 159 161 160 /* tables.c */ -
protocols/msn/msn_util.c
re97827b r3ef6410 54 54 { 55 55 struct msn_data *md = gc->proto_data; 56 GSList *l, **lp = NULL; 56 57 char buf[1024], *realname; 57 58 58 realname = msn_http_encode( realname_ ); 59 if( strcmp( list, "AL" ) == 0 ) 60 lp = &gc->permit; 61 else if( strcmp( list, "BL" ) == 0 ) 62 lp = &gc->deny; 63 64 if( lp ) 65 for( l = *lp; l; l = l->next ) 66 if( g_strcasecmp( l->data, who ) == 0 ) 67 return( 1 ); 68 69 realname = g_new0( char, strlen( realname_ ) * 3 + 1 ); 70 strcpy( realname, realname_ ); 71 http_encode( realname ); 59 72 60 73 g_snprintf( buf, sizeof( buf ), "ADD %d %s %s %s\r\n", ++md->trId, list, who, realname ); … … 63 76 g_free( realname ); 64 77 78 if( lp ) 79 *lp = g_slist_append( *lp, g_strdup( who ) ); 80 65 81 return( 1 ); 66 82 } … … 74 90 { 75 91 struct msn_data *md = gc->proto_data; 92 GSList *l = NULL, **lp = NULL; 76 93 char buf[1024]; 94 95 if( strcmp( list, "AL" ) == 0 ) 96 lp = &gc->permit; 97 else if( strcmp( list, "BL" ) == 0 ) 98 lp = &gc->deny; 99 100 if( lp ) 101 { 102 for( l = *lp; l; l = l->next ) 103 if( g_strcasecmp( l->data, who ) == 0 ) 104 break; 105 106 if( !l ) 107 return( 1 ); 108 } 77 109 78 110 g_snprintf( buf, sizeof( buf ), "REM %d %s %s\r\n", ++md->trId, list, who ); 79 111 if( msn_write( gc, buf, strlen( buf ) ) ) 112 { 113 if( lp ) 114 *lp = g_slist_remove( *lp, l->data ); 115 80 116 return( 1 ); 117 } 81 118 82 119 return( 0 ); … … 313 350 return( 1 ); 314 351 } 315 316 /* The difference between this function and the normal http_encode() function317 is that this one escapes every 7-bit ASCII character because this is said318 to avoid some lame server-side checks when setting a real-name. Also,319 non-ASCII characters are not escaped because MSN servers don't seem to320 appreciate that! */321 char *msn_http_encode( const char *input )322 {323 char *ret, *s;324 int i;325 326 ret = s = g_new0( char, strlen( input ) * 3 + 1 );327 for( i = 0; input[i]; i ++ )328 if( input[i] & 128 )329 {330 *s = input[i];331 s ++;332 }333 else334 {335 g_snprintf( s, 4, "%%%02X", input[i] );336 s += 3;337 }338 339 return ret;340 } -
protocols/msn/passport.c
re97827b r3ef6410 59 59 rep->data = data; 60 60 rep->func = func; 61 rep->header = header;62 61 63 62 server = g_strdup( prd_cached ); … … 126 125 static char *passport_create_header( char *cookie, char *email, char *pwd ) 127 126 { 128 char *buffer ;127 char *buffer = g_new0( char, 2048 ); 129 128 char *currenttoken; 130 129 char *email_enc, *pwd_enc; 131 132 currenttoken = strstr( cookie, "lc=" );133 if( currenttoken == NULL )134 return NULL;135 130 136 131 email_enc = g_new0( char, strlen( email ) * 3 + 1 ); … … 142 137 http_encode( pwd_enc ); 143 138 144 buffer = g_strdup_printf( "Authorization: Passport1.4 OrgVerb=GET," 145 "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom," 146 "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc, 147 currenttoken ); 139 currenttoken = strstr( cookie, "lc=" ); 140 if( currenttoken == NULL ) 141 return( NULL ); 142 143 g_snprintf( buffer, 2048, 144 "Authorization: Passport1.4 OrgVerb=GET," 145 "OrgURL=http%%3A%%2F%%2Fmessenger%%2Emsn%%2Ecom," 146 "sign-in=%s,pwd=%s,%s", email_enc, pwd_enc, 147 currenttoken ); 148 148 149 149 g_free( email_enc ); 150 150 g_free( pwd_enc ); 151 151 152 return buffer;152 return( buffer ); 153 153 } 154 154 -
protocols/yahoo/yahoo.c
re97827b r3ef6410 192 192 gc->away = NULL; 193 193 194 if( state && msg && g_strcasecmp( state, msg ) != 0)194 if( msg ) 195 195 { 196 196 yd->current_status = YAHOO_STATUS_CUSTOM; 197 197 gc->away = ""; 198 198 } 199 else if( state ) 200 { 201 /* Set msg to NULL since (if it isn't NULL already) it's equal 202 to state. msg must be empty if we want to use an existing 203 away state. */ 204 msg = NULL; 205 199 if( state ) 200 { 206 201 gc->away = ""; 207 202 if( g_strcasecmp( state, "Available" ) == 0 ) … … 240 235 yd->current_status = YAHOO_STATUS_AVAILABLE; 241 236 242 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 237 if( yd->current_status == YAHOO_STATUS_INVISIBLE ) 238 yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL ); 239 else 240 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL ); 243 241 } 244 242 -
root_commands.c
re97827b r3ef6410 656 656 657 657 irc_usermsg( irc, format, "Handle", "Nickname" ); 658 for( l = a->gc-> permit; l; l = l->next )658 for( l = a->gc->deny; l; l = l->next ) 659 659 { 660 660 user_t *u = user_findhandle( a->gc, l->data );
Note: See TracChangeset
for help on using the changeset viewer.