Changeset 8c1eb80 for protocols/jabber
- Timestamp:
- 2008-02-03T16:59:39Z (17 years ago)
- Branches:
- master
- Children:
- 8ff0a61
- Parents:
- 979cfb4
- Location:
- protocols/jabber
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
r979cfb4 r8c1eb80 92 92 else if( strcmp( s, XMLNS_DISCOVER ) == 0 ) 93 93 { 94 const char *features[] = { XMLNS_VERSION, 94 const char *features[] = { XMLNS_DISCOVER, 95 XMLNS_VERSION, 95 96 XMLNS_TIME, 96 97 XMLNS_CHATSTATES, -
protocols/jabber/jabber.h
r979cfb4 r8c1eb80 166 166 #define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */ 167 167 #define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user"/* XEP-0045 */ 168 #define XMLNS_CAPS "http://jabber.org/protocol/caps" /* XEP-0115 */ 168 169 169 170 /* iq.c */ -
protocols/jabber/presence.c
r979cfb4 r8c1eb80 29 29 char *from = xt_find_attr( node, "from" ); 30 30 char *type = xt_find_attr( node, "type" ); /* NULL should mean the person is online. */ 31 struct xt_node *c ;31 struct xt_node *c, *cap; 32 32 struct jabber_buddy *bud, *send_presence = NULL; 33 33 int is_chat = 0; … … 76 76 else 77 77 bud->priority = 0; 78 79 if( bud && ( cap = xt_find_node( node->children, "c" ) ) && 80 ( s = xt_find_attr( cap, "xmlns" ) ) && strcmp( s, XMLNS_CAPS ) == 0 ) 81 { 82 /* This <presence> stanza includes an XEP-0115 83 capabilities part. Not too interesting, but we can 84 see if it has an ext= attribute. */ 85 s = xt_find_attr( cap, "ext" ); 86 if( s && ( strstr( s, "cstates" ) || strstr( s, "chatstate" ) ) ) 87 bud->flags |= JBFLAG_DOES_XEP85; 88 89 /* This field can contain more information like xhtml 90 support, but we don't support that ourselves. 91 Officially the ext= tag was deprecated, but enough 92 clients do send it. 93 94 (I'm aware that this is not the right way to use 95 this field.) See for an explanation of ext=: 96 http://www.xmpp.org/extensions/attic/xep-0115-1.3.html*/ 97 } 78 98 79 99 if( is_chat ) … … 186 206 { 187 207 struct jabber_data *jd = ic->proto_data; 188 struct xt_node *node ;208 struct xt_node *node, *cap; 189 209 char *show = jd->away_state->code; 190 210 char *status = jd->away_message; … … 199 219 xt_add_child( node, xt_new_node( "status", status, NULL ) ); 200 220 221 /* This makes the packet slightly bigger, but clients interested in 222 capabilities can now cache the discovery info. This reduces the 223 usual post-login iq-flood. See XEP-0115. At least libpurple and 224 Trillian seem to do this right. */ 225 cap = xt_new_node( "c", NULL, NULL ); 226 xt_add_attr( cap, "xmlns", XMLNS_CAPS ); 227 xt_add_attr( cap, "node", "http://bitlbee.org/xmpp/caps" ); 228 xt_add_attr( cap, "ver", BITLBEE_VERSION ); /* The XEP wants this hashed, but nobody's doing that. */ 229 xt_add_child( node, cap ); 230 201 231 st = jabber_write_packet( ic, node ); 202 232
Note: See TracChangeset
for help on using the changeset viewer.