Ignore:
Timestamp:
2010-03-07T18:43:23Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
279607e
Parents:
e08e53c (diff), c32f492 (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 in mainline, including improved away/status stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    re08e53c rfb020ac  
    190190                int is_away = 0;
    191191
    192                 if( send_presence->away_state && !( *send_presence->away_state->code == 0 ||
    193                     strcmp( send_presence->away_state->code, "chat" ) == 0 ) )
     192                if( send_presence->away_state &&
     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 ) ?
    198                                    send_presence->away_state->full_name : NULL,
     197                                   is_away ? send_presence->away_state->full_name : NULL,
    199198                                   send_presence->away_message );
    200199        }
     
    209208        struct jabber_data *jd = ic->proto_data;
    210209        struct xt_node *node, *cap;
    211         char *show = jd->away_state->code;
    212         char *status = jd->away_message;
    213210        struct groupchat *c;
    214211        int st;
     
    216213        node = jabber_make_packet( "presence", NULL, NULL, NULL );
    217214        xt_add_child( node, xt_new_node( "priority", set_getstr( &ic->acc->set, "priority" ), 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 ) );
     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 ) );
    222219       
    223220        /* This makes the packet slightly bigger, but clients interested in
Note: See TracChangeset for help on using the changeset viewer.