diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp index a7240c8..322b482 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubEventSubscriptionSerializer.cpp @@ -22,27 +22,27 @@ PubSubEventSubscriptionSerializer::~PubSubEventSubscriptionSerializer() { } std::string PubSubEventSubscriptionSerializer::serializePayload(boost::shared_ptr<PubSubEventSubscription> payload) const { - if (!payload) { - return ""; - } - XMLElement element("subscription", "http://jabber.org/protocol/pubsub#event"); - element.setAttribute("node", payload->getNode()); - element.setAttribute("jid", payload->getJID()); - element.setAttribute("subscription", serializeSubscriptionType(payload->getSubscription())); - if (payload->getSubscriptionID()) { - element.setAttribute("subid", *payload->getSubscriptionID()); - } - element.setAttribute("expiry", dateTimeToString(payload->getExpiry())); - return element.serialize(); + if (!payload) { + return ""; + } + XMLElement element("subscription", "http://jabber.org/protocol/pubsub#event"); + element.setAttribute("node", payload->getNode()); + element.setAttribute("jid", payload->getJID()); + element.setAttribute("subscription", serializeSubscriptionType(payload->getSubscription())); + if (payload->getSubscriptionID()) { + element.setAttribute("subid", *payload->getSubscriptionID()); + } + element.setAttribute("expiry", dateTimeToString(payload->getExpiry())); + return element.serialize(); } std::string PubSubEventSubscriptionSerializer::serializeSubscriptionType(PubSubEventSubscription::SubscriptionType value) { - switch (value) { - case PubSubEventSubscription::None: return "none"; - case PubSubEventSubscription::Pending: return "pending"; - case PubSubEventSubscription::Subscribed: return "subscribed"; - case PubSubEventSubscription::Unconfigured: return "unconfigured"; - } - assert(false); - return ""; + switch (value) { + case PubSubEventSubscription::None: return "none"; + case PubSubEventSubscription::Pending: return "pending"; + case PubSubEventSubscription::Subscribed: return "subscribed"; + case PubSubEventSubscription::Unconfigured: return "unconfigured"; + } + assert(false); + return ""; } |