diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-01 14:04:11 (GMT) |
---|---|---|
committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-01 14:04:11 (GMT) |
commit | ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e (patch) | |
tree | 8a0e945d4031520054bb08e14a3228b21cef0eb2 /Swift | |
parent | ddd4265b65c4a523d6f86abf6cad8fcda16be021 (diff) | |
download | swift-contrib-ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e.zip swift-contrib-ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e.tar.bz2 |
log utc offset.
Diffstat (limited to 'Swift')
-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 c03cc2c..7461a1e 100644 --- a/Swift/Controllers/HistoryController.cpp +++ b/Swift/Controllers/HistoryController.cpp @@ -22,7 +22,10 @@ HistoryController::~HistoryController() { void HistoryController::addMessage(const std::string& message, const JID& fromJID, const JID& toJID, HistoryMessage::Type type, const boost::posix_time::ptime& 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)); + boost::posix_time::ptime localTime = boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(timeStamp); + int offset = (localTime - timeStamp).hours(); + + HistoryMessage historyMessage(message, fromJID, toJID, type, localTime, offset); localHistory_->addMessage(historyMessage); onNewMessage(historyMessage); |