summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-08-04 20:45:19 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-08-04 20:45:19 (GMT)
commit5d21021b92a3d7d5755e80a5be10cfbdf984b9db (patch)
treeca6b0b5e7a025bd9dabaeed2d1d6cc59d3feeab0 /Swift/Controllers/Chat/ChatsManager.cpp
parent85e23f6d04ea4d31a325f5267c78cbba2cbbac92 (diff)
downloadswift-contrib-5d21021b92a3d7d5755e80a5be10cfbdf984b9db.zip
swift-contrib-5d21021b92a3d7d5755e80a5be10cfbdf984b9db.tar.bz2
Factor Chat Message Parsing out and test it
Change-Id: Ia11dbebc736ecf9996f6d0fcc4550b749c55d433
Diffstat (limited to 'Swift/Controllers/Chat/ChatsManager.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatsManager.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 5dd53c1..415931c 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -46,4 +46,5 @@
#include <Swift/Controllers/SettingConstants.h>
#include <Swift/Controllers/WhiteboardManager.h>
+#include <Swift/Controllers/Chat/ChatMessageParser.h>
namespace Swift {
@@ -80,5 +81,5 @@ ChatsManager::ChatsManager(
HighlightManager* highlightManager,
ClientBlockListManager* clientBlockListManager,
- std::map<std::string, std::string>* emoticons) :
+ const std::map<std::string, std::string>& emoticons) :
jid_(jid),
joinMUCWindowFactory_(joinMUCWindowFactory),
@@ -94,6 +95,5 @@ ChatsManager::ChatsManager(
whiteboardManager_(whiteboardManager),
highlightManager_(highlightManager),
- clientBlockListManager_(clientBlockListManager),
- emoticons_(emoticons) {
+ clientBlockListManager_(clientBlockListManager) {
timerFactory_ = timerFactory;
eventController_ = eventController;
@@ -109,4 +109,5 @@ ChatsManager::ChatsManager(
mucBookmarkManager_ = NULL;
profileSettings_ = profileSettings;
+ chatMessageParser_ = new ChatMessageParser(emoticons);
presenceOracle_->onPresenceChange.connect(boost::bind(&ChatsManager::handlePresenceChange, this, _1));
uiEventConnection_ = uiEventStream_->onUIEvent.connect(boost::bind(&ChatsManager::handleUIEvent, this, _1));
@@ -153,4 +154,5 @@ ChatsManager::~ChatsManager() {
delete mucBookmarkManager_;
delete mucSearchController_;
+ delete chatMessageParser_;
}
@@ -530,5 +532,5 @@ ChatController* ChatsManager::getChatControllerOrFindAnother(const JID &contact)
ChatController* ChatsManager::createNewChatController(const JID& contact) {
assert(chatControllers_.find(contact) == chatControllers_.end());
- ChatController* controller = new ChatController(jid_, stanzaChannel_, iqRouter_, chatWindowFactory_, contact, nickResolver_, presenceOracle_, avatarManager_, mucRegistry_->isMUC(contact.toBare()), useDelayForLatency_, uiEventStream_, eventController_, timerFactory_, entityCapsProvider_, userWantsReceipts_, settings_, historyController_, mucRegistry_, highlightManager_, clientBlockListManager_, emoticons_);
+ ChatController* controller = new ChatController(jid_, stanzaChannel_, iqRouter_, chatWindowFactory_, contact, nickResolver_, presenceOracle_, avatarManager_, mucRegistry_->isMUC(contact.toBare()), useDelayForLatency_, uiEventStream_, eventController_, timerFactory_, entityCapsProvider_, userWantsReceipts_, settings_, historyController_, mucRegistry_, highlightManager_, clientBlockListManager_, chatMessageParser_);
chatControllers_[contact] = controller;
controller->setAvailableServerFeatures(serverDiscoInfo_);
@@ -603,5 +605,5 @@ void ChatsManager::handleJoinMUCRequest(const JID &mucJID, const boost::optional
muc->setCreateAsReservedIfNew();
}
- MUCController* controller = new MUCController(jid_, muc, password, nick, stanzaChannel_, iqRouter_, chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory_, eventController_, entityCapsProvider_, roster_, historyController_, mucRegistry_, highlightManager_, emoticons_);
+ MUCController* controller = new MUCController(jid_, muc, password, nick, stanzaChannel_, iqRouter_, chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory_, eventController_, entityCapsProvider_, roster_, historyController_, mucRegistry_, highlightManager_, chatMessageParser_);
mucControllers_[mucJID] = controller;
controller->setAvailableServerFeatures(serverDiscoInfo_);