Ignore:
Timestamp:
2006-10-31T08:25:41Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0d3f30f
Parents:
abbd8ed
Message:

Added #defines for XML namespaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/iq.c

    rabbd8ed r47d3ac4  
    7777               
    7878                /* Of course this is a very essential query to support. ;-) */
    79                 if( strcmp( s, "jabber:iq:version" ) == 0 )
     79                if( strcmp( s, XMLNS_VERSION ) == 0 )
    8080                {
    8181                        xt_add_child( reply, xt_new_node( "name", "BitlBee", NULL ) );
     
    8383                        xt_add_child( reply, xt_new_node( "os", ARCH, NULL ) );
    8484                }
    85                 else if( strcmp( s, "jabber:iq:time" ) == 0 )
     85                else if( strcmp( s, XMLNS_TIME ) == 0 )
    8686                {
    8787                        time_t time_ep;
     
    9797                        xt_add_child( reply, xt_new_node( "tz", buf, NULL ) );
    9898                }
    99                 else if( strcmp( s, "http://jabber.org/protocol/disco#info" ) == 0 )
     99                else if( strcmp( s, XMLNS_DISCOVER ) == 0 )
    100100                {
    101101                        c = xt_new_node( "identity", NULL, NULL );
     
    106106                       
    107107                        c = xt_new_node( "feature", NULL, NULL );
    108                         xt_add_attr( c, "var", "jabber:iq:version" );
     108                        xt_add_attr( c, "var", XMLNS_VERSION );
    109109                        xt_add_child( reply, c );
    110110                       
    111111                        c = xt_new_node( "feature", NULL, NULL );
    112                         xt_add_attr( c, "var", "jabber:iq:time" );
     112                        xt_add_attr( c, "var", XMLNS_TIME );
    113113                        xt_add_child( reply, c );
    114114                       
    115115                        c = xt_new_node( "feature", NULL, NULL );
    116                         xt_add_attr( c, "var", "http://jabber.org/protocol/chatstates" );
     116                        xt_add_attr( c, "var", XMLNS_CHATSTATES );
    117117                        xt_add_child( reply, c );
    118118                       
     
    136136                }
    137137               
    138                 if( strcmp( s, "jabber:iq:roster" ) == 0 )
     138                if( strcmp( s, XMLNS_ROSTER ) == 0 )
    139139                {
    140140                        int bare_len = strlen( gc->acc->user );
     
    198198       
    199199        node = xt_new_node( "query", NULL, xt_new_node( "username", jd->username, NULL ) );
    200         xt_add_attr( node, "xmlns", "jabber:iq:auth" );
     200        xt_add_attr( node, "xmlns", XMLNS_AUTH );
    201201        node = jabber_make_packet( "iq", "get", NULL, node );
    202202       
     
    218218        /* Time to authenticate ourselves! */
    219219        reply = xt_new_node( "query", NULL, NULL );
    220         xt_add_attr( reply, "xmlns", "jabber:iq:auth" );
     220        xt_add_attr( reply, "xmlns", XMLNS_AUTH );
    221221        xt_add_child( reply, xt_new_node( "username", jd->username, NULL ) );
    222222        xt_add_child( reply, xt_new_node( "resource", set_getstr( &gc->acc->set, "resource" ), NULL ) );
     
    322322       
    323323        node = xt_new_node( "query", NULL, NULL );
    324         xt_add_attr( node, "xmlns", "jabber:iq:roster" );
     324        xt_add_attr( node, "xmlns", XMLNS_ROSTER );
    325325        node = jabber_make_packet( "iq", "get", NULL, node );
    326326       
     
    391391       
    392392        node = xt_new_node( "vCard", NULL, NULL );
    393         xt_add_attr( node, "xmlns", "vcard-temp" );
     393        xt_add_attr( node, "xmlns", XMLNS_VCARD );
    394394        node = jabber_make_packet( "iq", "get", bare_jid, node );
    395395       
     
    536536        /* And pack it into a roster-add packet */
    537537        node = xt_new_node( "query", NULL, node );
    538         xt_add_attr( node, "xmlns", "jabber:iq:roster" );
     538        xt_add_attr( node, "xmlns", XMLNS_ROSTER );
    539539        node = jabber_make_packet( "iq", "set", NULL, node );
    540540       
     
    557557        /* And pack it into a roster-add packet */
    558558        node = xt_new_node( "query", NULL, node );
    559         xt_add_attr( node, "xmlns", "jabber:iq:roster" );
     559        xt_add_attr( node, "xmlns", XMLNS_ROSTER );
    560560        node = jabber_make_packet( "iq", "set", NULL, node );
    561561       
Note: See TracChangeset for help on using the changeset viewer.