Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    r840bba8 r71d45c2  
    190190                int is_away = 0;
    191191
    192                 if( send_presence->away_state &&
    193                     strcmp( send_presence->away_state->code, "chat" ) != 0 )
     192                if( send_presence->away_state && !( *send_presence->away_state->code == 0 ||
     193                    strcmp( send_presence->away_state->code, "chat" ) == 0 ) )
    194194                        is_away = OPT_AWAY;
    195195
    196196                imcb_buddy_status( ic, send_presence->bare_jid, OPT_LOGGED_IN | is_away,
    197                                    is_away ? send_presence->away_state->full_name : NULL,
     197                                   ( is_away && send_presence->away_state ) ?
     198                                   send_presence->away_state->full_name : NULL,
    198199                                   send_presence->away_message );
    199200        }
     
    208209        struct jabber_data *jd = ic->proto_data;
    209210        struct xt_node *node, *cap;
     211        char *show = jd->away_state->code;
     212        char *status = jd->away_message;
    210213        struct groupchat *c;
    211214        int st;
     
    213216        node = jabber_make_packet( "presence", NULL, NULL, NULL );
    214217        xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), NULL ) );
    215         if( jd->away_state )
    216                 xt_add_child( node, xt_new_node( "show", jd->away_state->code, NULL ) );
    217         if( jd->away_message )
    218                 xt_add_child( node, xt_new_node( "status", jd->away_message, NULL ) );
     218        if( show && *show )
     219                xt_add_child( node, xt_new_node( "show", show, NULL ) );
     220        if( status )
     221                xt_add_child( node, xt_new_node( "status", status, NULL ) );
    219222       
    220223        /* This makes the packet slightly bigger, but clients interested in
Note: See TracChangeset for help on using the changeset viewer.