summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/Controllers/HistoryViewController.cpp4
-rw-r--r--Swift/Controllers/HistoryViewController.h6
-rw-r--r--Swift/Controllers/MainController.cpp7
3 files changed, 14 insertions, 3 deletions
diff --git a/Swift/Controllers/HistoryViewController.cpp b/Swift/Controllers/HistoryViewController.cpp
index f208925..f88d097 100644
--- a/Swift/Controllers/HistoryViewController.cpp
+++ b/Swift/Controllers/HistoryViewController.cpp
@@ -16,9 +16,13 @@ namespace Swift {
HistoryViewController::HistoryViewController(
UIEventStream* uiEventStream,
HistoryController* historyController,
+ NickResolver* nickResolver,
+ AvatarManager* avatarManager,
HistoryWindowFactory* historyWindowFactory) :
uiEventStream_(uiEventStream),
historyController_(historyController),
+ nickResolver_(nickResolver),
+ avatarManager_(avatarManager),
historyWindowFactory_(historyWindowFactory),
historyWindow_(NULL) {
uiEventStream_->onUIEvent.connect(boost::bind(&HistoryViewController::handleUIEvent, this, _1));
diff --git a/Swift/Controllers/HistoryViewController.h b/Swift/Controllers/HistoryViewController.h
index 94e5df3..7dabf46 100644
--- a/Swift/Controllers/HistoryViewController.h
+++ b/Swift/Controllers/HistoryViewController.h
@@ -18,10 +18,12 @@ namespace Swift {
class Roster;
class RosterItem;
class HistoryController;
+ class NickResolver;
+ class AvatarManager;
class HistoryViewController {
public:
- HistoryViewController(UIEventStream* uiEventStream, HistoryController* historyController, HistoryWindowFactory* historyWindowFactory);
+ HistoryViewController(UIEventStream* uiEventStream, HistoryController* historyController, NickResolver* nickResolver, AvatarManager* avatarManager, HistoryWindowFactory* historyWindowFactory);
~HistoryViewController();
private:
@@ -31,6 +33,8 @@ namespace Swift {
private:
UIEventStream* uiEventStream_;
HistoryController* historyController_;
+ NickResolver* nickResolver_;
+ AvatarManager* avatarManager_;
HistoryWindowFactory* historyWindowFactory_;
HistoryWindow* historyWindow_;
Roster* roster_;
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index e376dc2..60a882a 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -114,6 +114,7 @@ MainController::MainController(
eventNotifier_ = NULL;
rosterController_ = NULL;
chatsManager_ = NULL;
+ historyViewController_ = NULL;
eventWindowController_ = NULL;
profileController_ = NULL;
contactEditController_ = NULL;
@@ -172,7 +173,6 @@ MainController::MainController(
xmlConsoleController_ = new XMLConsoleController(uiEventStream_, uiFactory_);
historyController_ = new HistoryController();
- historyViewController_ = new HistoryViewController(uiEventStream_, historyController_, uiFactory_);
fileTransferListController_ = new FileTransferListController(uiEventStream_, uiFactory_);
@@ -198,7 +198,6 @@ MainController::~MainController() {
delete fileTransferListController_;
delete xmlConsoleController_;
delete historyController_;
- delete historyViewController_;
delete xmppURIController_;
delete soundEventController_;
delete systemTrayController_;
@@ -224,6 +223,8 @@ void MainController::resetClient() {
eventWindowController_ = NULL;
delete chatsManager_;
chatsManager_ = NULL;
+ delete historyViewController_;
+ historyViewController_ = NULL;
delete ftOverview_;
ftOverview_ = NULL;
delete rosterController_;
@@ -297,6 +298,8 @@ void MainController::handleConnected() {
contactEditController_ = new ContactEditController(rosterController_, client_->getVCardManager(), uiFactory_, uiEventStream_);
chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, uiFactory_, uiFactory_, client_->getNickResolver(), client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, uiFactory_, useDelayForLatency_, networkFactories_->getTimerFactory(), client_->getMUCRegistry(), client_->getEntityCapsProvider(), client_->getMUCManager(), uiFactory_, profileSettings_, ftOverview_, client_->getRoster(), !settings_->getSetting(SettingConstants::REMEMBER_RECENT_CHATS), settings_, historyController_);
+
+ historyViewController_ = new HistoryViewController(uiEventStream_, historyController_, client_->getNickResolver(), client_->getAvatarManager(), uiFactory_);
client_->onMessageReceived.connect(boost::bind(&ChatsManager::handleIncomingMessage, chatsManager_, _1));
chatsManager_->setAvatarManager(client_->getAvatarManager());