summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Serializer/PayloadSerializers')
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp11
-rw-r--r--Swiften/Serializer/PayloadSerializers/DelaySerializer.h1
2 files changed, 2 insertions, 10 deletions
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
index 4f86faa..6148632 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.cpp
@@ -11,6 +11,7 @@
#include <Swiften/Base/String.h>
#include <Swiften/Serializer/XML/XMLElement.h>
+#include <Swiften/Base/DateTime.h>
namespace Swift {
@@ -22,16 +23,8 @@ std::string DelaySerializer::serializePayload(boost::shared_ptr<Delay> delay) c
if (delay->getFrom()) {
delayElement.setAttribute("from", delay->getFrom()->toString());
}
- std::string stampString = boostPTimeToXEP0082(delay->getStamp());
- delayElement.setAttribute("stamp", stampString);
+ delayElement.setAttribute("stamp", dateTimeToString(delay->getStamp()));
return delayElement.serialize();
}
-std::string DelaySerializer::boostPTimeToXEP0082(const boost::posix_time::ptime& time) {
- std::string stampString = std::string(boost::posix_time::to_iso_extended_string(time));
- String::replaceAll(stampString, ',', ".");
- stampString += "Z";
- return stampString;
-}
-
}
diff --git a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
index 4705e71..06c7665 100644
--- a/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
+++ b/Swiften/Serializer/PayloadSerializers/DelaySerializer.h
@@ -15,7 +15,6 @@ namespace Swift {
DelaySerializer();
virtual std::string serializePayload(boost::shared_ptr<Delay>) const;
- static std::string boostPTimeToXEP0082(const boost::posix_time::ptime& time);
};
}