Changeset 2288705 for protocols/jabber


Ignore:
Timestamp:
2009-12-07T21:54:19Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1c3008a
Parents:
aac4017 (diff), 36cf9fd (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 head.

Location:
protocols/jabber
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/conference.c

    raac4017 r2288705  
    2626static xt_status jabber_chat_join_failed( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
    2727
    28 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password )
     28struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password )
    2929{
    3030        struct jabber_chat *jc;
     
    3636        node = xt_new_node( "x", NULL, NULL );
    3737        xt_add_attr( node, "xmlns", XMLNS_MUC );
    38         node = jabber_make_packet( "presence", NULL, roomjid, node );
    3938        if( password )
    4039                xt_add_child( node, xt_new_node( "password", password, NULL ) );
     40        node = jabber_make_packet( "presence", NULL, roomjid, node );
    4141        jabber_cache_add( ic, node, jabber_chat_join_failed );
    4242       
     
    234234                            ( strcmp( s, XMLNS_MUC_USER ) == 0 ) )
    235235                        {
    236                                 c = xt_find_node( c->children, "item" );
    237                                 if( ( s = xt_find_attr( c, "jid" ) ) )
     236                                struct xt_node *item;
     237                               
     238                                item = xt_find_node( c->children, "item" );
     239                                if( ( s = xt_find_attr( item, "jid" ) ) )
    238240                                {
    239241                                        /* Yay, found what we need. :-) */
     
    283285        else if( type ) /* type can only be NULL or "unavailable" in this function */
    284286        {
    285                 s = strchr( bud->ext_jid, '/' );
    286                 if( s ) *s = 0;
    287                 imcb_chat_remove_buddy( chat, bud->ext_jid, NULL );
    288                 if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS )
    289                         imcb_remove_buddy( ic, bud->ext_jid, NULL );
    290                 if( s ) *s = '/';
     287                if( ( bud->flags & JBFLAG_IS_CHATROOM ) && bud->ext_jid )
     288                {
     289                        s = strchr( bud->ext_jid, '/' );
     290                        if( s ) *s = 0;
     291                        imcb_chat_remove_buddy( chat, bud->ext_jid, NULL );
     292                        if( bud != jc->me && bud->flags & JBFLAG_IS_ANONYMOUS )
     293                                imcb_remove_buddy( ic, bud->ext_jid, NULL );
     294                        if( s ) *s = '/';
     295                }
    291296               
    292297                if( bud == jc->me )
  • protocols/jabber/iq.c

    raac4017 r2288705  
    5151        {
    5252                if( !( ( c = xt_find_node( node->children, "query" ) ) ||
    53                        ( c = xt_find_node( node->children, "ping" ) ) ) || /* O_o WHAT is wrong with just <query/> ????? */
     53                       ( c = xt_find_node( node->children, "ping" ) ) ) ||
    5454                    !( s = xt_find_attr( c, "xmlns" ) ) )
    5555                {
    56                         imcb_log( ic, "Warning: Received incomplete IQ-%s packet", type );
     56                        /* Sigh. Who decided to suddenly invent new elements
     57                           instead of just sticking with <query/>? */
    5758                        return XT_HANDLED;
    5859                }
  • protocols/jabber/jabber.c

    raac4017 r2288705  
    7070       
    7171        s = set_add( &acc->set, "server", NULL, set_eval_account, acc );
    72         s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY;
     72        s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY | SET_NULL_OK;
    7373       
    7474        s = set_add( &acc->set, "ssl", "false", set_eval_bool, acc );
     
    439439}
    440440
    441 static struct groupchat *jabber_chat_join_( struct im_connection *ic, char *room, char *nick, char *password )
     441static struct groupchat *jabber_chat_join_( struct im_connection *ic, const char *room, const char *nick, const char *password )
    442442{
    443443        if( strchr( room, '@' ) == NULL )
  • protocols/jabber/jabber.h

    raac4017 r2288705  
    2727#include <glib.h>
    2828
     29#include "bitlbee.h"
     30#include "md5.h"
    2931#include "xmltree.h"
    30 #include "bitlbee.h"
    3132
    3233extern GSList *jabber_connections;
     
    302303
    303304/* conference.c */
    304 struct groupchat *jabber_chat_join( struct im_connection *ic, char *room, char *nick, char *password );
     305struct groupchat *jabber_chat_join( struct im_connection *ic, const char *room, const char *nick, const char *password );
    305306struct groupchat *jabber_chat_by_jid( struct im_connection *ic, const char *name );
    306307void jabber_chat_free( struct groupchat *c );
  • protocols/jabber/jabber_util.c

    raac4017 r2288705  
    3737                /* Priority is a signed 8-bit integer, according to RFC 3921. */
    3838                if( i < -128 || i > 127 )
    39                         return NULL;
     39                        return SET_INVALID;
    4040        }
    4141        else
    42                 return NULL;
     42                return SET_INVALID;
    4343       
    4444        /* Only run this stuff if the account is online ATM,
  • protocols/jabber/presence.c

    raac4017 r2288705  
    4949                if( !( bud = jabber_buddy_by_jid( ic, from, GET_BUDDY_EXACT | GET_BUDDY_CREAT ) ) )
    5050                {
    51                         if( set_getbool( &ic->irc->set, "debug" ) )
    52                                 imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from );
     51                        /*
     52                        imcb_log( ic, "Warning: Could not handle presence information from JID: %s", from );
     53                        */
    5354                        return XT_HANDLED;
    5455                }
     
    106107                if( ( bud = jabber_buddy_by_jid( ic, from, 0 ) ) == NULL )
    107108                {
    108                         if( set_getbool( &ic->irc->set, "debug" ) )
    109                                 imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from );
     109                        /*
     110                        imcb_log( ic, "Warning: Received presence information from unknown JID: %s", from );
     111                        */
    110112                        return XT_HANDLED;
    111113                }
Note: See TracChangeset for help on using the changeset viewer.