Ignore:
Timestamp:
2015-01-26T02:43:34Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
fcb2c2e
Parents:
8519f45
git-author:
dequis <dx@…> (20-07-14 06:28:49)
git-committer:
dequis <dx@…> (26-01-15 02:43:34)
Message:

Add handle_is_self() prpl function to fix JID mismatch confusion bugs

When bee_chat needs to check for self messages, it can call this
function to let the protocol implementation do the comparison.

In the case of jabber, sometimes the server reports a different username
after login, this one is stored in jd->internal_jid, and the one that is
used for login isn't changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r8519f45 rbe1efa3  
    318318        g_free( jd->oauth2_access_token );
    319319        g_free( jd->away_message );
     320        g_free( jd->internal_jid );
    320321        g_free( jd->username );
    321322        g_free( jd->me );
     
    619620       
    620621        return NULL;
     622}
     623
     624gboolean jabber_handle_is_self( struct im_connection *ic, const char *who ) {
     625        struct jabber_data *jd = ic->proto_data;
     626        return ( ( g_strcasecmp( who, ic->acc->user ) == 0 ) ||
     627                 ( jd->internal_jid &&
     628                   g_strcasecmp( who, jd->internal_jid ) == 0 ) );
    621629}
    622630
     
    648656        ret->send_typing = jabber_send_typing;
    649657        ret->handle_cmp = g_strcasecmp;
     658        ret->handle_is_self = jabber_handle_is_self;
    650659        ret->transfer_request = jabber_si_transfer_request;
    651660        ret->buddy_action_list = jabber_buddy_action_list;
Note: See TracChangeset for help on using the changeset viewer.