Ignore:
Timestamp:
2006-10-15T20:24:01Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d74c644
Parents:
e617b35
Message:

Proper cleanup of jabber buddy structures when removing a buddy from the
list, proper checking (and handling) of events related to buddies that
aren't "hashed" yet, limit checks on priorityto setting, renamed JEP85
to XEP85, support for more XEP85 states.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    re617b35 r788a1af  
    3131        struct xt_node *c;
    3232        struct jabber_buddy *bud;
     33        char *s;
    3334       
    3435        if( !from )
     
    3738        if( type == NULL )
    3839        {
    39                 if( strchr( from, '/' ) == NULL )
     40                if( ( s = strchr( from, '/' ) ) == NULL )
    4041                {
    4142                        char *s = xt_to_string( node );
    42                         serv_got_crap( gc, "WARNING: Ignoring presence tag with bare JID: %s\n", s );
     43                        serv_got_crap( gc, "WARNING: Ignoring presence tag with bare JID: %s", s );
    4344                        g_free( s );
    4445                        return XT_HANDLED;
     
    4748                if( !( bud = jabber_buddy_by_jid( gc, from ) ) )
    4849                {
     50                        /* FOR NOW, s still contains the location of the /.
     51                           Keep this in mind when changing things here. :-) */
     52                       
     53                        /* We check if the buddy is in the contact list,
     54                           because Jabber servers seem to like to send
     55                           presence information of buddies we removed
     56                           from our list sometimes, for example... */
     57                       
     58                        *s = 0;
     59                        if( find_buddy( gc, from ) == NULL )
     60                        {
     61                                *s = '/';
     62                                serv_got_crap( gc, "WARNING: Ignoring presence information from unknown JID: %s", from );
     63                                return XT_HANDLED;
     64                        }
     65                        *s = '/';
     66                       
    4967                        bud = jabber_buddy_add( gc, from );
    5068                }
     
    83101                        serv_got_crap( gc, "WARNING: Ignoring presence tag with bare JID: %s\n", s );
    84102                        g_free( s );
     103                        return XT_HANDLED;
     104                }
     105               
     106                if( jabber_buddy_by_jid( gc, from ) == NULL )
     107                {
     108                        serv_got_crap( gc, "WARNING: Received presence information from unknown JID: %s", from );
    85109                        return XT_HANDLED;
    86110                }
Note: See TracChangeset for help on using the changeset viewer.