Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r3dc9d46 r5e202b0  
    183183static GList *msn_away_states( struct gaim_connection *gc )
    184184{
    185         GList *l = NULL;
     185        static GList *l = NULL;
    186186        int i;
    187187       
    188         for( i = 0; msn_away_state_list[i].number > -1; i ++ )
    189                 l = g_list_append( l, (void*) msn_away_state_list[i].name );
    190        
    191         return( l );
     188        if( l == NULL )
     189                for( i = 0; msn_away_state_list[i].number > -1; i ++ )
     190                        l = g_list_append( l, (void*) msn_away_state_list[i].name );
     191       
     192        return l;
    192193}
    193194
     
    366367        struct gaim_connection *gc = acc->gc;
    367368        struct msn_data *md;
    368         char buf[1024], *fn;
     369        char buf[1024], *fn, *s;
     370        int i;
    369371       
    370372        /* Double-check. */
     
    380382        }
    381383       
    382         fn = msn_http_encode( value );
     384        /* Of course we could use http_encode() here, but when we encode
     385           every character, the server is less likely to complain about the
     386           chosen name. However, the MSN server doesn't seem to like escaped
     387           non-ASCII chars, so we keep those unescaped. */
     388        s = fn = g_new0( char, strlen( value ) * 3 + 1 );
     389        for( i = 0; value[i]; i ++ )
     390                if( value[i] & 128 )
     391                {
     392                        *s = value[i];
     393                        s ++;
     394                }
     395                else
     396                {
     397                        g_snprintf( s, 4, "%%%02X", value[i] );
     398                        s += 3;
     399                }
    383400       
    384401        g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn );
Note: See TracChangeset for help on using the changeset viewer.