diff options
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); |