- Timestamp:
- 2006-10-31T08:25:41Z (18 years ago)
- Branches:
- master
- Children:
- 0d3f30f
- Parents:
- abbd8ed
- Location:
- protocols/jabber
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
rabbd8ed r47d3ac4 307 307 { 308 308 reply = xt_new_node( "starttls", NULL, NULL ); 309 xt_add_attr( reply, "xmlns", "urn:ietf:params:xml:ns:xmpp-tls");309 xt_add_attr( reply, "xmlns", XMLNS_TLS ); 310 310 if( !jabber_write_packet( gc, reply ) ) 311 311 { … … 355 355 { 356 356 reply = xt_new_node( "bind", NULL, xt_new_node( "resource", set_getstr( &gc->acc->set, "resource" ), NULL ) ); 357 xt_add_attr( reply, "xmlns", "urn:ietf:params:xml:ns:xmpp-bind");357 xt_add_attr( reply, "xmlns", XMLNS_BIND ); 358 358 reply = jabber_make_packet( "iq", "set", NULL, reply ); 359 359 jabber_cache_add( gc, reply, jabber_pkt_bind_sess ); … … 368 368 { 369 369 reply = xt_new_node( "session", NULL, NULL ); 370 xt_add_attr( reply, "xmlns", "urn:ietf:params:xml:ns:xmpp-session");370 xt_add_attr( reply, "xmlns", XMLNS_SESSION ); 371 371 reply = jabber_make_packet( "iq", "set", NULL, reply ); 372 372 jabber_cache_add( gc, reply, jabber_pkt_bind_sess ); … … 400 400 /* Just ignore it when it doesn't seem to be TLS-related (is that at 401 401 all possible??). */ 402 if( !xmlns || strcmp( xmlns, "urn:ietf:params:xml:ns:xmpp-tls") != 0 )402 if( !xmlns || strcmp( xmlns, XMLNS_TLS ) != 0 ) 403 403 return XT_HANDLED; 404 404 … … 433 433 { 434 434 if( !( s = xt_find_attr( c, "xmlns" ) ) || 435 strcmp( s, "urn:ietf:params:xml:ns:xmpp-streams") != 0 )435 strcmp( s, XMLNS_STREAM_ERROR ) != 0 ) 436 436 continue; 437 437 -
protocols/jabber/iq.c
rabbd8ed r47d3ac4 77 77 78 78 /* 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 ) 80 80 { 81 81 xt_add_child( reply, xt_new_node( "name", "BitlBee", NULL ) ); … … 83 83 xt_add_child( reply, xt_new_node( "os", ARCH, NULL ) ); 84 84 } 85 else if( strcmp( s, "jabber:iq:time") == 0 )85 else if( strcmp( s, XMLNS_TIME ) == 0 ) 86 86 { 87 87 time_t time_ep; … … 97 97 xt_add_child( reply, xt_new_node( "tz", buf, NULL ) ); 98 98 } 99 else if( strcmp( s, "http://jabber.org/protocol/disco#info") == 0 )99 else if( strcmp( s, XMLNS_DISCOVER ) == 0 ) 100 100 { 101 101 c = xt_new_node( "identity", NULL, NULL ); … … 106 106 107 107 c = xt_new_node( "feature", NULL, NULL ); 108 xt_add_attr( c, "var", "jabber:iq:version");108 xt_add_attr( c, "var", XMLNS_VERSION ); 109 109 xt_add_child( reply, c ); 110 110 111 111 c = xt_new_node( "feature", NULL, NULL ); 112 xt_add_attr( c, "var", "jabber:iq:time");112 xt_add_attr( c, "var", XMLNS_TIME ); 113 113 xt_add_child( reply, c ); 114 114 115 115 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 ); 117 117 xt_add_child( reply, c ); 118 118 … … 136 136 } 137 137 138 if( strcmp( s, "jabber:iq:roster") == 0 )138 if( strcmp( s, XMLNS_ROSTER ) == 0 ) 139 139 { 140 140 int bare_len = strlen( gc->acc->user ); … … 198 198 199 199 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 ); 201 201 node = jabber_make_packet( "iq", "get", NULL, node ); 202 202 … … 218 218 /* Time to authenticate ourselves! */ 219 219 reply = xt_new_node( "query", NULL, NULL ); 220 xt_add_attr( reply, "xmlns", "jabber:iq:auth");220 xt_add_attr( reply, "xmlns", XMLNS_AUTH ); 221 221 xt_add_child( reply, xt_new_node( "username", jd->username, NULL ) ); 222 222 xt_add_child( reply, xt_new_node( "resource", set_getstr( &gc->acc->set, "resource" ), NULL ) ); … … 322 322 323 323 node = xt_new_node( "query", NULL, NULL ); 324 xt_add_attr( node, "xmlns", "jabber:iq:roster");324 xt_add_attr( node, "xmlns", XMLNS_ROSTER ); 325 325 node = jabber_make_packet( "iq", "get", NULL, node ); 326 326 … … 391 391 392 392 node = xt_new_node( "vCard", NULL, NULL ); 393 xt_add_attr( node, "xmlns", "vcard-temp");393 xt_add_attr( node, "xmlns", XMLNS_VCARD ); 394 394 node = jabber_make_packet( "iq", "get", bare_jid, node ); 395 395 … … 536 536 /* And pack it into a roster-add packet */ 537 537 node = xt_new_node( "query", NULL, node ); 538 xt_add_attr( node, "xmlns", "jabber:iq:roster");538 xt_add_attr( node, "xmlns", XMLNS_ROSTER ); 539 539 node = jabber_make_packet( "iq", "set", NULL, node ); 540 540 … … 557 557 /* And pack it into a roster-add packet */ 558 558 node = xt_new_node( "query", NULL, node ); 559 xt_add_attr( node, "xmlns", "jabber:iq:roster");559 xt_add_attr( node, "xmlns", XMLNS_ROSTER ); 560 560 node = jabber_make_packet( "iq", "set", NULL, node ); 561 561 -
protocols/jabber/jabber.c
rabbd8ed r47d3ac4 235 235 we guess when s/he pressed Enter...). */ 236 236 act = xt_new_node( "active", NULL, NULL ); 237 xt_add_attr( act, "xmlns", "http://jabber.org/protocol/chatstates");237 xt_add_attr( act, "xmlns", XMLNS_CHATSTATES ); 238 238 xt_add_child( node, act ); 239 239 … … 353 353 354 354 node = xt_new_node( type, NULL, NULL ); 355 xt_add_attr( node, "xmlns", "http://jabber.org/protocol/chatstates");355 xt_add_attr( node, "xmlns", XMLNS_CHATSTATES ); 356 356 node = jabber_make_packet( "message", "chat", bud->full_jid, node ); 357 357 -
protocols/jabber/jabber.h
rabbd8ed r47d3ac4 114 114 #define JABBER_CACHED_ID "BeeC" 115 115 116 /* RFC 392[01] stuff */ 117 #define XMLNS_TLS "urn:ietf:params:xml:ns:xmpp-tls" 118 #define XMLNS_SASL "urn:ietf:params:xml:ns:xmpp-sasl" 119 #define XMLNS_BIND "urn:ietf:params:xml:ns:xmpp-bind" 120 #define XMLNS_SESSION "urn:ietf:params:xml:ns:xmpp-session" 121 #define XMLNS_STANZA_ERROR "urn:ietf:params:xml:ns:xmpp-stanzas" 122 #define XMLNS_STREAM_ERROR "urn:ietf:params:xml:ns:xmpp-streams" 123 #define XMLNS_ROSTER "jabber:iq:roster" 124 125 /* Some supported extensions/legacy stuff */ 126 #define XMLNS_AUTH "jabber:iq:auth" /* XEP-0078 */ 127 #define XMLNS_VERSION "jabber:iq:version" /* XEP-0092 */ 128 #define XMLNS_TIME "jabber:iq:time" /* XEP-0090 */ 129 #define XMLNS_VCARD "vcard-temp" /* XEP-0054 */ 130 #define XMLNS_CHATSTATES "http://jabber.org/protocol/chatstates" /* 0085 */ 131 #define XMLNS_DISCOVER "http://jabber.org/protocol/disco#info" /* 0030 */ 132 116 133 /* iq.c */ 117 134 xt_status jabber_pkt_iq( struct xt_node *node, gpointer data ); -
protocols/jabber/jabber_util.c
rabbd8ed r47d3ac4 104 104 /* Create the "defined-condition" tag. */ 105 105 c = xt_new_node( err_cond, NULL, NULL ); 106 xt_add_attr( c, "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas");106 xt_add_attr( c, "xmlns", XMLNS_STANZA_ERROR ); 107 107 108 108 /* Put it in an <error> tag. */ -
protocols/jabber/sasl.c
rabbd8ed r47d3ac4 24 24 #include "jabber.h" 25 25 #include "base64.h" 26 27 #define SASL_NS "urn:ietf:params:xml:ns:xmpp-sasl"28 26 29 27 xt_status sasl_pkt_mechanisms( struct xt_node *node, gpointer data ) … … 45 43 46 44 s = xt_find_attr( node, "xmlns" ); 47 if( !s || strcmp( s, SASL_NS) != 0 )45 if( !s || strcmp( s, XMLNS_SASL ) != 0 ) 48 46 { 49 47 signoff( gc ); … … 70 68 71 69 reply = xt_new_node( "auth", NULL, NULL ); 72 xt_add_attr( reply, "xmlns", SASL_NS);70 xt_add_attr( reply, "xmlns", XMLNS_SASL ); 73 71 74 72 if( sup_digest ) … … 272 270 273 271 reply = xt_new_node( "response", s, NULL ); 274 xt_add_attr( reply, "xmlns", SASL_NS);272 xt_add_attr( reply, "xmlns", XMLNS_SASL ); 275 273 276 274 if( !jabber_write_packet( gc, reply ) ) … … 303 301 304 302 s = xt_find_attr( node, "xmlns" ); 305 if( !s || strcmp( s, SASL_NS) != 0 )303 if( !s || strcmp( s, XMLNS_SASL ) != 0 ) 306 304 { 307 305 signoff( gc );
Note: See TracChangeset
for help on using the changeset viewer.