summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp')
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
index 041165f..a54cf9e 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
@@ -20,11 +20,16 @@ String DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) const
if (delay->getFrom()) {
delayElement.setAttribute("from", delay->getFrom()->toString());
}
- String stampString = String(boost::posix_time::to_iso_extended_string(delay->getStamp()));
- stampString.replaceAll(',', ".");
- stampString += "Z";
+ String stampString = boostPTimeToXEP0082(delay->getStamp());
delayElement.setAttribute("stamp", stampString);
return delayElement.serialize();
}
+String DelaySerializer::boostPTimeToXEP0082(const boost::posix_time::ptime& time) {
+ String stampString = String(boost::posix_time::to_iso_extended_string(time));
+ stampString.replaceAll(',', ".");
+ stampString += "Z";
+ return stampString;
+}
+
}