Ignore:
Timestamp:
2011-12-26T10:51:19Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
199fea6
Parents:
96f954d (diff), 644b808 (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 oauth-xmpp branch, which adds support for OAuth2 authentication
against some XMPP services (Google Talk, Facebook and Microsoft's MSN-XMPP
gateway).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r96f954d r5f40da7  
    3131{
    3232        struct im_connection *ic = data;
     33        struct jabber_data *jd = ic->proto_data;
    3334        struct xt_node *c, *reply = NULL;
    3435        char *type, *s;
     
    170171                   was added to (or removed from) the buddy list. AFAIK they're
    171172                   sent even if we added this buddy in our own session. */
    172                         int bare_len = strlen( ic->acc->user );
     173                        int bare_len = strlen( jd->me );
    173174                       
    174175                        if( ( s = xt_find_attr( node, "from" ) ) == NULL ||
    175                             ( strncmp( s, ic->acc->user, bare_len ) == 0 &&
     176                            ( strncmp( s, jd->me, bare_len ) == 0 &&
    176177                              ( s[bare_len] == 0 || s[bare_len] == '/' ) ) )
    177178                        {
     
    343344        {
    344345                c = xt_find_node( c->children, "jid" );
    345                 if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
    346                     strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
     346                if( !c || !c->text )
     347                {
     348                        /* Server is crap, but this is no disaster. */
     349                }
     350                else if( strncmp( jd->me, c->text, strlen( jd->me ) ) != 0 )
     351                {
     352                        s = strchr( c->text, '/' );
     353                        if( s )
     354                                *s = '\0';
     355                        jabber_set_me( ic, c->text );
     356                        imcb_log( ic, "Server claims your JID is `%s' instead of `%s'. "
     357                                  "This mismatch may cause problems with groupchats "
     358                                  "and possibly other things.",
     359                                  c->text, ic->acc->user );
     360                        if( s )
     361                                *s = '/';
     362                }
     363                else if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
     364                         strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
    347365                        imcb_log( ic, "Server changed session resource string to `%s'", s + 1 );
    348366        }
Note: See TracChangeset for help on using the changeset viewer.