Mercurial > pidgin
diff libpurple/protocols/jabber/presence.c @ 19489:b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Tue, 28 Aug 2007 19:03:07 +0000 |
parents | f821d4bffb0a |
children | 481749fc0b6b |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c Tue Aug 28 07:09:48 2007 +0000 +++ b/libpurple/protocols/jabber/presence.c Tue Aug 28 19:03:07 2007 +0000 @@ -256,39 +256,39 @@ xmlnode_set_namespace(c, "http://jabber.org/protocol/caps"); xmlnode_set_attrib(c, "node", CAPS0115_NODE); xmlnode_set_attrib(c, "ver", VERSION); - - if(js != NULL) { - /* add the extensions */ - char extlist[1024]; - unsigned remaining = 1023; /* one less for the \0 */ - GList *feature; - - extlist[0] = '\0'; - for(feature = jabber_features; feature && remaining > 0; feature = feature->next) { - JabberFeature *feat = (JabberFeature*)feature->data; - unsigned featlen; - + + if(js != NULL) { + /* add the extensions */ + char extlist[1024]; + unsigned remaining = 1023; /* one less for the \0 */ + GList *feature; + + extlist[0] = '\0'; + for(feature = jabber_features; feature && remaining > 0; feature = feature->next) { + JabberFeature *feat = (JabberFeature*)feature->data; + unsigned featlen; + if(feat->is_enabled != NULL && feat->is_enabled(js, feat->shortname, feat->namespace) == FALSE) continue; /* skip this feature */ featlen = strlen(feat->shortname); - - /* cut off when we don't have any more space left in our buffer (too bad) */ - if(featlen > remaining) - break; - - strncat(extlist,feat->shortname,remaining); - remaining -= featlen; - if(feature->next) { /* no space at the end */ - strncat(extlist," ",remaining); - --remaining; - } - } - /* did we add anything? */ - if(remaining < 1023) - xmlnode_set_attrib(c, "ext", extlist); - } - + + /* cut off when we don't have any more space left in our buffer (too bad) */ + if(featlen > remaining) + break; + + strncat(extlist,feat->shortname,remaining); + remaining -= featlen; + if(feature->next) { /* no space at the end */ + strncat(extlist," ",remaining); + --remaining; + } + } + /* did we add anything? */ + if(remaining < 1023) + xmlnode_set_attrib(c, "ext", extlist); + } + return presence; }