Ignore:
Timestamp:
2010-10-02T05:34:53Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2af3e23
Parents:
05bf2a0 (diff), 04cd284 (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 msnp13 branch which, confusingly, upgrades the msn module to use
MSNP15. (The reason for this is that A) IMHO MSNP13 is what causes most of
the pain in this upgade and B) I initially intended to only implement MSNP13
but then discovered MS doesn't support it anymore.)

This fixes issues with display names being forgotten, adding contacts (and
them automatically getting blocked sometimes!!), and adds support for
away/status messages and some support for sending offline messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/bee_user.c

    r05bf2a0 r62f53b50  
    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( bu->status == NULL && ( flags & OPT_MOBILE ) &&
     
    205210}
    206211
     212/* Same, but only change the away/status message, not any away/online state info. */
     213void imcb_buddy_status_msg( struct im_connection *ic, const char *handle, const char *message )
     214{
     215        bee_t *bee = ic->bee;
     216        bee_user_t *bu, *old;
     217       
     218        if( !( bu = bee_user_by_handle( bee, ic, handle ) ) )
     219        {
     220                return;
     221        }
     222       
     223        old = g_memdup( bu, sizeof( bee_user_t ) );
     224       
     225        bu->status_msg = message && *message ? g_strdup( message ) : NULL;
     226       
     227        if( bee->ui->user_status )
     228                bee->ui->user_status( bee, bu, old );
     229       
     230        g_free( old->status_msg );
     231        g_free( old );
     232}
     233
    207234void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle )
    208235{
Note: See TracChangeset for help on using the changeset viewer.