summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-08-01 14:04:11 (GMT)
committerCatalin Badea <catalin.badea392@gmail.com>2012-08-01 14:04:11 (GMT)
commitad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e (patch)
tree8a0e945d4031520054bb08e14a3228b21cef0eb2 /Swift/Controllers/HistoryController.cpp
parentddd4265b65c4a523d6f86abf6cad8fcda16be021 (diff)
downloadswift-contrib-ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e.zip
swift-contrib-ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e.tar.bz2
log utc offset.
Diffstat (limited to 'Swift/Controllers/HistoryController.cpp')
-rw-r--r--Swift/Controllers/HistoryController.cpp5
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);