/* * Copyright (c) 2012 Catalin Badea * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include namespace Swift { HistoryController::HistoryController() : remoteArchiveSupported_(false) { std::string file("testDB.db"); localHistory_ = new SQLiteHistoryManager(file); } HistoryController::~HistoryController() { delete localHistory_; } void HistoryController::addMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp) { HistoryMessage historyMessage(message, fromJID, toJID, timeStamp); localHistory_->addMessage(historyMessage); } std::vector HistoryController::getMessages(const JID& selfJID, const JID& contactJID) const { return localHistory_->getMessages(selfJID, contactJID); } std::vector HistoryController::getAllContacts() const { return localHistory_->getAllContacts(); } }