diff options
author | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-02 15:01:55 (GMT) |
---|---|---|
committer | Catalin Badea <catalin.badea392@gmail.com> | 2012-08-02 15:01:55 (GMT) |
commit | 87f470205a4b77a0a6c034e478bde24551111669 (patch) | |
tree | fc6343771074a4459a11fecbb8b057c9846c7067 /Swift/Controllers/HistoryController.cpp | |
parent | ad45dd54efd3fdd336f84f5af82dffcaf6dfbe4e (diff) | |
download | swift-contrib-87f470205a4b77a0a6c034e478bde24551111669.zip swift-contrib-87f470205a4b77a0a6c034e478bde24551111669.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); +} + } |