diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp')
m--------- | Swiften | 0 | ||||
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp | 36 |
2 files changed, 0 insertions, 36 deletions
diff --git a/Swiften b/Swiften new file mode 160000 +Subproject 8213ba16d0043d2461f4b031c881d61dda5a38c diff --git a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp deleted file mode 100644 index 4c39574..0000000 --- a/Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "Swiften/Serializer/PayloadSerializers/DiscoInfoSerializer.h" - -#include <boost/shared_ptr.hpp> - -#include "Swiften/Base/foreach.h" -#include "Swiften/Serializer/XML/XMLElement.h" - -namespace Swift { - -DiscoInfoSerializer::DiscoInfoSerializer() : GenericPayloadSerializer<DiscoInfo>() { -} - -String DiscoInfoSerializer::serializePayload(boost::shared_ptr<DiscoInfo> discoInfo) const { - XMLElement queryElement("query", "http://jabber.org/protocol/disco#info"); - if (!discoInfo->getNode().isEmpty()) { - queryElement.setAttribute("node", discoInfo->getNode()); - } - foreach(const DiscoInfo::Identity& identity, discoInfo->getIdentities()) { - boost::shared_ptr<XMLElement> identityElement(new XMLElement("identity")); - if (!identity.getLanguage().isEmpty()) { - identityElement->setAttribute("xml:lang", identity.getLanguage()); - } - identityElement->setAttribute("category", identity.getCategory()); - identityElement->setAttribute("name", identity.getName()); - identityElement->setAttribute("type", identity.getType()); - queryElement.addNode(identityElement); - } - foreach(const String& feature, discoInfo->getFeatures()) { - boost::shared_ptr<XMLElement> featureElement(new XMLElement("feature")); - featureElement->setAttribute("var", feature); - queryElement.addNode(featureElement); - } - return queryElement.serialize(); -} - -} |