Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 1215:80c095886fb5
Entity Capabilities support (XEP-0115)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 08 May 2007 10:00:32 +0200 |
parents | 4a7db2870685 |
children | f7b35b1c343d |
comparison
equal
deleted
inserted
replaced
1214:9f5c5f176953 | 1215:80c095886fb5 |
---|---|
321 inline const char *jb_getstatusmsg() | 321 inline const char *jb_getstatusmsg() |
322 { | 322 { |
323 return mystatusmsg; | 323 return mystatusmsg; |
324 } | 324 } |
325 | 325 |
326 // insert_entity_capabilities(presence_stanza) | |
327 // Entity Capabilities (XEP-0115) | |
328 static void insert_entity_capabilities(xmlnode x) | |
329 { | |
330 xmlnode y; | |
331 const char *ver = entity_version(); | |
332 | |
333 y = xmlnode_insert_tag(x, "c"); | |
334 xmlnode_put_attrib(y, "xmlns", NS_CAPS); | |
335 xmlnode_put_attrib(y, "node", MCABBER_CAPS_NODE); | |
336 xmlnode_put_attrib(y, "ver", ver); | |
337 #ifdef JEP0085 | |
338 if (!chatstates_disabled) | |
339 xmlnode_put_attrib(y, "ext", "csn"); | |
340 #endif | |
341 } | |
342 | |
326 static void roompresence(gpointer room, void *presencedata) | 343 static void roompresence(gpointer room, void *presencedata) |
327 { | 344 { |
328 const char *bjid; | 345 const char *bjid; |
329 const char *nickname; | 346 const char *nickname; |
330 char *to; | 347 char *to; |
433 // (But we want to update internal status even when disconnected, | 450 // (But we want to update internal status even when disconnected, |
434 // in order to avoid some problems during network failures) | 451 // in order to avoid some problems during network failures) |
435 if (online) { | 452 if (online) { |
436 const char *s_msg = (st != invisible ? msg : NULL); | 453 const char *s_msg = (st != invisible ? msg : NULL); |
437 x = presnew(st, recipient, s_msg); | 454 x = presnew(st, recipient, s_msg); |
455 insert_entity_capabilities(x); // Entity Capabilities (XEP-0115) | |
438 #ifdef HAVE_GPGME | 456 #ifdef HAVE_GPGME |
439 if (!do_not_sign && gpg_enabled()) { | 457 if (!do_not_sign && gpg_enabled()) { |
440 char *signature; | 458 char *signature; |
441 signature = gpg_sign(s_msg ? s_msg : ""); | 459 signature = gpg_sign(s_msg ? s_msg : ""); |
442 if (signature) { | 460 if (signature) { |