diff options
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 046b2772..8930847d 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 ) @@ -138,8 +142,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; } @@ -148,17 +153,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 ) ); } |