Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/disco.c @ 17576:e49b259fc7dd
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Fri, 15 Jun 2007 07:13:41 +0000 |
parents | 0370da969e8a |
children | f88b3a093cba |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/disco.c Wed Jun 13 16:03:11 2007 +0000 +++ b/libpurple/protocols/jabber/disco.c Fri Jun 15 07:13:41 2007 +0000 @@ -37,9 +37,10 @@ JabberDiscoInfoCallback *callback; }; -#define SUPPORT_FEATURE(x) \ +#define SUPPORT_FEATURE(x) { \ feature = xmlnode_new_child(query, "feature"); \ - xmlnode_set_attrib(feature, "var", x); + xmlnode_set_attrib(feature, "var", x); \ +} void jabber_disco_info_parse(JabberStream *js, xmlnode *packet) { @@ -98,11 +99,12 @@ SUPPORT_FEATURE("http://jabber.org/protocol/xhtml-im") SUPPORT_FEATURE("http://www.xmpp.org/extensions/xep-0199.html#ns") - if(!node) { /* non-caps disco#info, add all extensions */ + if(!node) { /* non-caps disco#info, add all enabled extensions */ GList *features; for(features = jabber_features; features; features = features->next) { JabberFeature *feat = (JabberFeature*)features->data; - SUPPORT_FEATURE(feat->namespace); + if(feat->is_enabled == NULL || feat->is_enabled(js, feat->shortname, feat->namespace) == TRUE) + SUPPORT_FEATURE(feat->namespace); } } } else { @@ -129,8 +131,8 @@ for(features = jabber_features; features; features = features->next) { JabberFeature *feat = (JabberFeature*)features->data; if(!strcmp(feat->shortname, ext)) { - SUPPORT_FEATURE(feat->namespace); - break; + SUPPORT_FEATURE(feat->namespace); + break; } } if(features == NULL)