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/jabber_util.c

    rc737ba7 re35d1a1  
    4848                   call p_s_u() now to send the new prio setting, it would
    4949                   send the old setting because the set->value gets changed
    50                    when the eval returns a non-NULL value.
     50                   after the (this) eval returns a non-NULL value.
    5151                   
    5252                   So now I can choose between implementing post-set
     
    129129/* Cache a node/packet for later use. Mainly useful for IQ packets if you need
    130130   them when you receive the response. Use this BEFORE sending the packet so
    131    it'll get a new id= tag, and do NOT free() the packet after writing it! */
     131   it'll get a new id= tag, and do NOT free() the packet after sending it! */
    132132void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func )
    133133{
     
    252252
    253253/* Returns a new string. Don't leak it! */
    254 char *jabber_normalize( char *orig )
     254char *jabber_normalize( const char *orig )
    255255{
    256256        int len, i;
     
    353353        if( ( s = strchr( jid, '/' ) ) )
    354354        {
     355                int none_found = 0;
     356               
    355357                *s = 0;
    356358                if( ( bud = g_hash_table_lookup( jd->buddies, jid ) ) )
     
    370372                        }
    371373                }
    372                
    373                 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && imcb_find_buddy( ic, jid ) )
     374                else
     375                {
     376                        /* This hack is there to make sure that O_CREAT will
     377                           work if there's already another resouce present
     378                           for this JID, even if it's an unknown buddy. This
     379                           is done to handle conferences properly. */
     380                        none_found = 1;
     381                }
     382               
     383                if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && ( imcb_find_buddy( ic, jid ) || !none_found ) )
    374384                {
    375385                        *s = '/';
     
    531541        }
    532542}
     543
     544struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name )
     545{
     546        char *normalized = jabber_normalize( name );
     547        struct groupchat *ret;
     548        struct jabber_chat *jc;
     549       
     550        for( ret = ic->groupchats; ret; ret = ret->next )
     551        {
     552                jc = ret->data;
     553                if( strcmp( normalized, jc->name ) == 0 )
     554                        break;
     555        }
     556        g_free( normalized );
     557       
     558        return ret;
     559}
Note: See TracChangeset for help on using the changeset viewer.