diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp index fd6eebd..eeab2b7 100644 --- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp @@ -23,32 +23,32 @@ UserTuneSerializer::~UserTuneSerializer() { } std::string UserTuneSerializer::serializePayload(boost::shared_ptr<UserTune> payload) const { - if (!payload) { - return ""; - } - XMLElement element("tune", "http://jabber.org/protocol/tune"); - if (payload->getRating()) { - element.addNode(boost::make_shared<XMLElement>("rating", "", boost::lexical_cast<std::string>(*payload->getRating()))); - } - if (payload->getTitle()) { - element.addNode(boost::make_shared<XMLElement>("title", "", *payload->getTitle())); - } - if (payload->getTrack()) { - element.addNode(boost::make_shared<XMLElement>("track", "", *payload->getTrack())); - } - if (payload->getArtist()) { - element.addNode(boost::make_shared<XMLElement>("artist", "", *payload->getArtist())); - } - if (payload->getURI()) { - element.addNode(boost::make_shared<XMLElement>("uri", "", *payload->getURI())); - } - if (payload->getSource()) { - element.addNode(boost::make_shared<XMLElement>("source", "", *payload->getSource())); - } - if (payload->getLength()) { - element.addNode(boost::make_shared<XMLElement>("length", "", boost::lexical_cast<std::string>(*payload->getLength()))); - } - return element.serialize(); + if (!payload) { + return ""; + } + XMLElement element("tune", "http://jabber.org/protocol/tune"); + if (payload->getRating()) { + element.addNode(boost::make_shared<XMLElement>("rating", "", boost::lexical_cast<std::string>(*payload->getRating()))); + } + if (payload->getTitle()) { + element.addNode(boost::make_shared<XMLElement>("title", "", *payload->getTitle())); + } + if (payload->getTrack()) { + element.addNode(boost::make_shared<XMLElement>("track", "", *payload->getTrack())); + } + if (payload->getArtist()) { + element.addNode(boost::make_shared<XMLElement>("artist", "", *payload->getArtist())); + } + if (payload->getURI()) { + element.addNode(boost::make_shared<XMLElement>("uri", "", *payload->getURI())); + } + if (payload->getSource()) { + element.addNode(boost::make_shared<XMLElement>("source", "", *payload->getSource())); + } + if (payload->getLength()) { + element.addNode(boost::make_shared<XMLElement>("length", "", boost::lexical_cast<std::string>(*payload->getLength()))); + } + return element.serialize(); } |