Changeset 0adce21


Ignore:
Timestamp:
2008-01-20T00:01:31Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
31e5846
Parents:
003553b
Message:

GET_BUDDY_FIRST wasn't actually implemented, even though it was in use
already. I don't want to know how long it took me to find out...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber_util.c

    r003553b r0adce21  
    392392                if( ( bud = g_hash_table_lookup( jd->buddies, jid ) ) )
    393393                {
     394                        /* Just return the first one for this bare JID. */
     395                        if( flags & GET_BUDDY_FIRST )
     396                        {
     397                                *s = '/';
     398                                g_free( jid );
     399                                return bud;
     400                        }
     401                       
    394402                        /* Is this one of those no-resource buddies? */
    395403                        if( bud->resource == NULL )
    396404                        {
     405                                *s = '/';
    397406                                g_free( jid );
    398407                                return NULL;
    399408                        }
    400                         else
    401                         {
    402                                 /* See if there's an exact match. */
    403                                 for( ; bud; bud = bud->next )
    404                                         if( g_strcasecmp( bud->resource, s + 1 ) == 0 )
    405                                                 break;
    406                         }
     409                       
     410                        /* See if there's an exact match. */
     411                        for( ; bud; bud = bud->next )
     412                                if( g_strcasecmp( bud->resource, s + 1 ) == 0 )
     413                                        break;
    407414                }
    408415                else
     
    413420                           is done to handle conferences properly. */
    414421                        none_found = 1;
     422                        /* TODO(wilmer): Find out what I was thinking when I
     423                           wrote this??? And then fix it. This makes me sad... */
    415424                }
    416425               
     
    442451                else if( ( bud->resource == NULL || bud->next == NULL ) )
    443452                        /* No need for selection if there's only one option. */
     453                        return bud;
     454                else if( flags & GET_BUDDY_FIRST )
     455                        /* Looks like the caller doesn't care about details. */
    444456                        return bud;
    445457               
Note: See TracChangeset for help on using the changeset viewer.