diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-07-27 19:59:24 (GMT) |
---|---|---|
committer | Cătălin Badea <catalin.badea392@gmail.com> | 2012-08-11 15:59:13 (GMT) |
commit | c0f0ab471345fe3f3a3517bb302c7da1549c8f25 (patch) | |
tree | e215dd6564e1d8dbb4740319b4cd4c71d6c4813b /Swift/Controllers | |
parent | 22d4e0bfe7d78beba9fb24ef71513702340993b5 (diff) | |
download | swift-contrib-c0f0ab471345fe3f3a3517bb302c7da1549c8f25.zip swift-contrib-c0f0ab471345fe3f3a3517bb302c7da1549c8f25.tar.bz2 |
fix localtime utc conversion issues
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/HistoryController.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/Controllers/HistoryController.cpp b/Swift/Controllers/HistoryController.cpp index deda25b..c03cc2c 100644 --- a/Swift/Controllers/HistoryController.cpp +++ b/Swift/Controllers/HistoryController.cpp @@ -7,6 +7,7 @@ #include <Swift/Controllers/HistoryController.h> #include <Swiften/History/SQLiteHistoryManager.h> #include <Swiften/History/HistoryMessage.h> +#include <boost/date_time/c_local_time_adjustor.hpp> namespace Swift { @@ -20,7 +21,9 @@ HistoryController::~HistoryController() { } void HistoryController::addMessage(const std::string& message, const JID& fromJID, const JID& toJID, HistoryMessage::Type type, const boost::posix_time::ptime& timeStamp) { - HistoryMessage historyMessage(message, fromJID, toJID, type, timeStamp); + // note: using localtime timestamps + HistoryMessage historyMessage(message, fromJID, toJID, type, boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(timeStamp)); + localHistory_->addMessage(historyMessage); onNewMessage(historyMessage); } |