diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-02 15:01:55 (GMT) |
---|---|---|
committer | Cătălin Badea <catalin.badea392@gmail.com> | 2012-08-11 15:59:13 (GMT) |
commit | 2316553cb5a191e0e8b098bb5b39fba0d9e37b13 (patch) | |
tree | e3f905491ffa65ff83c069a792d5b851d10b2134 /Swift/Controllers/HistoryController.cpp | |
parent | f3401e17bf241734414a3ff84e94ee64b882bcbc (diff) | |
download | swift-contrib-2316553cb5a191e0e8b098bb5b39fba0d9e37b13.zip swift-contrib-2316553cb5a191e0e8b098bb5b39fba0d9e37b13.tar.bz2 |
use local db when joining a muc.
Diffstat (limited to 'Swift/Controllers/HistoryController.cpp')
-rw-r--r-- | Swift/Controllers/HistoryController.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/Controllers/HistoryController.cpp b/Swift/Controllers/HistoryController.cpp index 7461a1e..6ab1235 100644 --- a/Swift/Controllers/HistoryController.cpp +++ b/Swift/Controllers/HistoryController.cpp @@ -35,6 +35,11 @@ std::vector<HistoryMessage> HistoryController::getMessagesFromDate(const JID& se return localHistory_->getMessagesFromDate(selfJID, contactJID, type, date); } +std::vector<HistoryMessage> HistoryController::getMUCContext(const JID& selfJID, const JID& mucJID, const boost::posix_time::ptime& timeStamp) const { + boost::posix_time::ptime localTime = boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(timeStamp); + return getMessagesFromDate(selfJID, mucJID, HistoryMessage::Groupchat, localTime.date()); +} + std::vector<HistoryMessage> HistoryController::getMessagesFromPreviousDate(const JID& selfJID, const JID& contactJID, HistoryMessage::Type type, const boost::gregorian::date& date) const { return localHistory_->getMessagesFromPreviousDate(selfJID, contactJID, type, date); } @@ -47,4 +52,8 @@ ContactsMap HistoryController::getContacts(const JID& selfJID, HistoryMessage::T return localHistory_->getContacts(selfJID, type, keyword); } +boost::posix_time::ptime HistoryController::getLastTimeStampFromMUC(const JID& selfJID, const JID& mucJID) { + return localHistory_->getLastTimeStampFromMUC(selfJID, mucJID); +} + } |