diff options
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp')
-rw-r--r-- | Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp index 707f183..fbd4d53 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemSerializer.cpp @@ -30,7 +30,9 @@ std::string PubSubItemSerializer::serializePayload(boost::shared_ptr<PubSubItem> foreach(boost::shared_ptr<Payload> item, payload->getData()) { element.addNode(boost::make_shared<XMLRawTextNode>(serializers->getPayloadSerializer(item)->serialize(item))); } - element.setAttribute("id", payload->getID()); + if (!payload->getID().empty()) { + element.setAttribute("id", payload->getID()); + } return element.serialize(); } |