summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Badea <catalin.badea392@gmail.com>2012-06-27 12:02:47 (GMT)
committerCătălin Badea <catalin.badea392@gmail.com>2012-08-11 15:52:56 (GMT)
commitfc40104bf6e6d915561f95015e0b5617d97880e4 (patch)
treebbe91142e4c4dfcdaf32d4041694a8834a6683d8 /Swift/Controllers/HistoryViewController.cpp
parent9f11ec4954b7c860623c799827e73c40e73acfac (diff)
downloadswift-contrib-fc40104bf6e6d915561f95015e0b5617d97880e4.zip
swift-contrib-fc40104bf6e6d915561f95015e0b5617d97880e4.tar.bz2
Log messages to the sqlite db and dump all messages in the history viewer
Diffstat (limited to 'Swift/Controllers/HistoryViewController.cpp')
-rw-r--r--Swift/Controllers/HistoryViewController.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp
index cbfa687..1061e78 100644
--- a/Swift/Controllers/HistoryViewController.cpp
+++ b/Swift/Controllers/HistoryViewController.cpp
@@ -8,10 +8,19 @@
#include <Swift/Controllers/UIInterfaces/HistoryWindowFactory.h>
#include <Swift/Controllers/UIEvents/RequestHistoryUIEvent.h>
+#include <Swift/Controllers/HistoryController.h>
+#include <Swiften/History/HistoryMessage.h>
namespace Swift {
-HistoryViewController::HistoryViewController(UIEventStream* uiEventStream, HistoryWindowFactory* historyWindowFactory) : uiEventStream_(uiEventStream), historyWindowFactory_(historyWindowFactory), historyWindow_(NULL) {
+HistoryViewController::HistoryViewController(
+ UIEventStream* uiEventStream,
+ HistoryController* historyController,
+ HistoryWindowFactory* historyWindowFactory) :
+ uiEventStream_(uiEventStream),
+ historyController_(historyController),
+ historyWindowFactory_(historyWindowFactory),
+ historyWindow_(NULL) {
uiEventStream_->onUIEvent.connect(boost::bind(&HistoryViewController::handleUIEvent, this, _1));
}
@@ -37,6 +46,11 @@ void HistoryViewController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
roster_->addContact(medvedev, medvedev, "Dmitri Medvedev", "Recent", "");
roster_->addContact(kev, kev, "Kev", "Recent", "");
}
+
+ std::vector<HistoryMessage> messages = historyController_->getMessages();
+ for (std::vector<HistoryMessage>::iterator it = messages.begin(); it != messages.end(); it++) {
+ historyWindow_->addMessage(*it);
+ }
historyWindow_->activate();
}
}