Ignore:
Timestamp:
2010-06-05T23:21:02Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1fdb0a4
Parents:
3ab1d31 (diff), e774815 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of
stuff from mainline it seems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    r3ab1d31 rb308cf9  
    3131GSList *msn_switchboards;
    3232
    33 static char *msn_set_display_name( set_t *set, char *value );
     33static char *set_eval_display_name( set_t *set, char *value );
    3434
    3535static void msn_init( account_t *acc )
    3636{
    37         set_t *s;
    38        
    39         s = set_add( &acc->set, "display_name", NULL, msn_set_display_name, acc );
    40         s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY;
    41 
    42         s = set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
     37        set_add( &acc->set, "display_name", NULL, set_eval_display_name, acc );
     38        set_add( &acc->set, "local_display_name", "false", set_eval_bool, acc );
     39        set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
     40        set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc );
    4341}
    4442
     
    171169static void msn_set_my_name( struct im_connection *ic, char *info )
    172170{
    173         msn_set_display_name( set_find( &ic->acc->set, "display_name" ), info );
     171        msn_set_display_name( ic, info );
    174172}
    175173
     
    287285}
    288286
    289 static char *msn_set_display_name( set_t *set, char *value )
     287static char *set_eval_display_name( set_t *set, char *value )
    290288{
    291289        account_t *acc = set->data;
    292290        struct im_connection *ic = acc->ic;
    293         struct msn_data *md;
    294         char buf[1024], *fn;
    295        
    296         /* Double-check. */
     291       
     292        /* Allow any name if we're offline. */
    297293        if( ic == NULL )
    298                 return NULL;
    299        
    300         md = ic->proto_data;
     294                return value;
    301295       
    302296        if( strlen( value ) > 129 )
     
    305299                return NULL;
    306300        }
    307        
    308         fn = msn_http_encode( value );
    309        
    310         g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->acc->user, fn );
    311         msn_write( ic, buf, strlen( buf ) );
    312         g_free( fn );
    313301       
    314302        /* Returning NULL would be better, because the server still has to
    315303           confirm the name change. However, it looks a bit confusing to the
    316304           user. */
    317         return value;
     305        return msn_set_display_name( ic, value ) ? value : NULL;
    318306}
    319307
Note: See TracChangeset for help on using the changeset viewer.