diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 15:15:19 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-17 15:15:19 +0000 |
commit | e8c8d00ea43c204ee276bde7fb663a0f0249790f (patch) | |
tree | a98fdef3c5885eb2eac2ba047e244b3fd3c0f800 /protocols/msn/msn.c | |
parent | 1c3008ac0b2b29f7e14ec9b874af3277c511c7a4 (diff) | |
parent | f9928cb319c2879a56b7280f09723b26035982d0 (diff) |
Merging mainline.
Diffstat (limited to 'protocols/msn/msn.c')
-rw-r--r-- | protocols/msn/msn.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index b17a0bfa..3a8b8f7b 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -26,6 +26,10 @@ #include "nogaim.h" #include "msn.h" +int msn_chat_id; +GSList *msn_connections; +GSList *msn_switchboards; + static char *msn_set_display_name( set_t *set, char *value ); static void msn_init( account_t *acc ) @@ -142,8 +146,9 @@ static GList *msn_away_states( struct im_connection *ic ) int i; if( l == NULL ) - for( i = 0; msn_away_state_list[i].number > -1; i ++ ) - l = g_list_append( l, (void*) msn_away_state_list[i].name ); + for( i = 0; *msn_away_state_list[i].code; i ++ ) + if( *msn_away_state_list[i].name ) + l = g_list_append( l, (void*) msn_away_state_list[i].name ); return l; } @@ -152,17 +157,14 @@ static void msn_set_away( struct im_connection *ic, char *state, char *message ) { char buf[1024]; struct msn_data *md = ic->proto_data; - const struct msn_away_state *st; - if( strcmp( state, GAIM_AWAY_CUSTOM ) == 0 ) - st = msn_away_state_by_name( "Away" ); + if( state ) + md->away_state = msn_away_state_by_name( state ) ? : + msn_away_state_list + 1; else - st = msn_away_state_by_name( state ); - - if( !st ) st = msn_away_state_list; - md->away_state = st; + md->away_state = msn_away_state_list; - g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, st->code ); + g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code ); msn_write( ic, buf, strlen( buf ) ); } |