summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-08-01 14:04:11 (GMT)
committerCătălin Badea <catalin.badea392@gmail.com>2012-08-11 15:59:13 (GMT)
commitf3401e17bf241734414a3ff84e94ee64b882bcbc (patch)
tree1a90eaefb34dabdbaaff79f017e7084293502950 /Swift
parentf4a053500a27468c67c17531cb9f3b8d35880678 (diff)
downloadswift-contrib-f3401e17bf241734414a3ff84e94ee64b882bcbc.zip
swift-contrib-f3401e17bf241734414a3ff84e94ee64b882bcbc.tar.bz2
log utc offset.
Diffstat (limited to 'Swift')
-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);