Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee_user.c

    r203a2d2 rd93c0eb9  
    187187        /* TODO(wilmer): OPT_AWAY, or just state == NULL ? */
    188188        bu->flags = flags;
    189         bu->status = g_strdup( ( flags & OPT_AWAY ) && state == NULL ? "Away" : state );
    190189        bu->status_msg = g_strdup( message );
     190        if( state && *state )
     191                bu->status = g_strdup( state );
     192        else if( flags & OPT_AWAY )
     193                bu->status = g_strdup( "Away" );
     194        else
     195                bu->status = NULL;
    191196       
    192197        if( bee->ui->user_status )
     
    198203}
    199204
     205/* Same, but only change the away/status message, not any away/online state info. */
     206void imcb_buddy_status_msg( struct im_connection *ic, const char *handle, const char *message )
     207{
     208        bee_t *bee = ic->bee;
     209        bee_user_t *bu, *old;
     210       
     211        if( !( bu = bee_user_by_handle( bee, ic, handle ) ) )
     212        {
     213                return;
     214        }
     215       
     216        old = g_memdup( bu, sizeof( bee_user_t ) );
     217       
     218        bu->status_msg = g_strdup( message );
     219       
     220        if( bee->ui->user_status )
     221                bee->ui->user_status( bee, bu, old );
     222       
     223        g_free( old->status_msg );
     224        g_free( old );
     225}
     226
    200227void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle )
    201228{
Note: See TracChangeset for help on using the changeset viewer.