Ignore:
Timestamp:
2007-04-22T20:44:27Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
43671b9
Parents:
c737ba7
Message:

Read-only support for Jabber conferences (non-anonymous rooms only).
Just don't use this, you're really not going to like it. :-)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    rc737ba7 re35d1a1  
    3131        struct xt_node *c;
    3232        struct jabber_buddy *bud;
     33        int is_chat = 0;
    3334        char *s;
    3435       
    3536        if( !from )
    3637                return XT_HANDLED;
     38       
     39        if( ( s = strchr( from, '/' ) ) )
     40        {
     41                *s = 0;
     42                if( jabber_chat_by_name( ic, from ) )
     43                        is_chat = 1;
     44                *s = '/';
     45        }
    3746       
    3847        if( type == NULL )
     
    7281                        bud->priority = 0;
    7382               
    74                 if( bud == jabber_buddy_by_jid( ic, bud->bare_jid, 0 ) )
     83                if( is_chat )
     84                        jabber_chat_pkt_presence( ic, bud, node );
     85                else if( bud == jabber_buddy_by_jid( ic, bud->bare_jid, 0 ) )
    7586                        imcb_buddy_status( ic, bud->bare_jid, OPT_LOGGED_IN | is_away,
    7687                                           ( is_away && bud->away_state ) ? bud->away_state->full_name : NULL,
     
    7990        else if( strcmp( type, "unavailable" ) == 0 )
    8091        {
    81                 if( jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) == NULL )
     92                if( ( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT ) ) == NULL )
    8293                {
    8394                        if( set_getbool( &ic->irc->set, "debug" ) )
     
    8697                }
    8798               
     99                /* Handle this before we delete the JID. */
     100                if( is_chat )
     101                {
     102                        jabber_chat_pkt_presence( ic, bud, node );
     103                }
     104               
    88105                jabber_buddy_remove( ic, from );
    89106               
    90                 if( ( s = strchr( from, '/' ) ) )
     107                if( is_chat )
     108                {
     109                        /* Nothing else to do for now? */
     110                }
     111                else if( ( s = strchr( from, '/' ) ) )
    91112                {
    92113                        *s = 0;
     
    96117                        if( jabber_buddy_by_jid( ic, from, 0 ) == NULL )
    97118                                imcb_buddy_status( ic, from, 0, NULL, NULL );
     119                        /* FIXME: If this resource was not away and another resource is,
     120                           we should definitely send an update here. */
    98121                       
    99122                        *s = '/';
Note: See TracChangeset for help on using the changeset viewer.