Ignore:
Timestamp:
2007-11-28T21:07:30Z (16 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
2ff2076, fa30fa5
Parents:
221a273
Message:

Initial import of jabber file receive and DCC send support. This introduces
only a few changes to bitlbees code, mainly the addition of the "transfers"
command.

This is known to work with Kopete, Psi, and Pidgin (formerly known as gaim).
At least with Pidgin also over a proxy. DCC has only been tested with irssi.
IPV6 is untested but should work.

Currently, only receiving via SOCKS5BYTESREAMS is implemented. I'm not sure if
the alternative(in-band bytestreams IBB) is worth implementing since I didn't
see a client yet that can do it. Additionally, it is probably very slow and
needs support by the server as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    r221a273 r2c2df7d  
    104104                                                   XMLNS_CHATSTATES,
    105105                                                   XMLNS_MUC,
     106                                                   XMLNS_SI,
     107                                                   XMLNS_BYTESTREAMS,
     108                                                   XMLNS_FILETRANSFER,
    106109                                                   NULL };
    107110                        const char **f;
     
    123126                {
    124127                        xt_free_node( reply );
    125                         reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
     128                        reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel", NULL );
    126129                        pack = 0;
    127130                }
     
    129132        else if( strcmp( type, "set" ) == 0 )
    130133        {
    131                 if( !( c = xt_find_node( node->children, "query" ) ) ||
     134                if(  ( c = xt_find_node( node->children, "si" ) ) &&
     135                     ( strcmp( xt_find_attr( c, "xmlns" ), XMLNS_SI ) == 0 ) )
     136                {
     137                        return jabber_si_handle_request( ic, node, c );
     138                } else if( !( c = xt_find_node( node->children, "query" ) ) ||
    132139                    !( s = xt_find_attr( c, "xmlns" ) ) )
    133140                {
    134141                        imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
    135142                        return XT_HANDLED;
    136                 }
    137                
     143                } else if( strcmp( s, XMLNS_ROSTER ) == 0 )
     144                {
    138145                /* This is a roster push. XMPP servers send this when someone
    139146                   was added to (or removed from) the buddy list. AFAIK they're
    140147                   sent even if we added this buddy in our own session. */
    141                 if( strcmp( s, XMLNS_ROSTER ) == 0 )
    142                 {
    143148                        int bare_len = strlen( ic->acc->user );
    144149                       
     
    157162                               
    158163                                xt_free_node( reply );
    159                                 reply = jabber_make_error_packet( node, "not-allowed", "cancel" );
     164                                reply = jabber_make_error_packet( node, "not-allowed", "cancel", NULL );
    160165                                pack = 0;
    161166                        }
    162                 }
    163                 else
     167                } else if( strcmp( s, XMLNS_BYTESTREAMS ) == 0 )
     168                {
     169                        /* Bytestream Request (stage 2 of file transfer) */
     170                        return jabber_bs_request( ic, node, c );
     171                } else
    164172                {
    165173                        xt_free_node( reply );
    166                         reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel" );
     174                        reply = jabber_make_error_packet( node, "feature-not-implemented", "cancel", NULL );
    167175                        pack = 0;
    168176                }
Note: See TracChangeset for help on using the changeset viewer.