diff options
author | Tobias Markmann <tm@ayena.de> | 2015-01-22 22:24:16 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-02-16 16:55:03 (GMT) |
commit | 645a7a47c8105e7cad3fecd7bb66c8c16757eafe (patch) | |
tree | 3230a784bddfa6b7fd5d327e735451e625672af4 /Swift/Controllers/Chat/UnitTest | |
parent | 45eec1d00d5b9fabee1ce44f7dd8addd7d0cf6b3 (diff) | |
download | swift-645a7a47c8105e7cad3fecd7bb66c8c16757eafe.zip swift-645a7a47c8105e7cad3fecd7bb66c8c16757eafe.tar.bz2 |
Show a warning notice when trying to enter a blocked room
When the user tries to enter a blocked room, we now show a warning
notice and describing how the room can be unblocked. Swift will not
send the joining presence when trying to enter a blocked room.
Test-Information:
Tested on Mac OS X 10.9.5 against a popular open source server and its
MUC and Blocking Command implementation.
Change-Id: I875db056f21f97845c5a9a43167b0f2a16bdaa36
Diffstat (limited to 'Swift/Controllers/Chat/UnitTest')
-rw-r--r-- | Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp index 5a4d3b8..0b7b793 100644 --- a/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp +++ b/Swift/Controllers/Chat/UnitTest/MUCControllerTest.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,37 +7,40 @@ #include <cppunit/extensions/HelperMacros.h> #include <cppunit/extensions/TestFactoryRegistry.h> #include <boost/algorithm/string.hpp> + #include <hippomocks.h> -#include "Swiften/Base/foreach.h" -#include "Swift/Controllers/XMPPEvents/EventController.h" -#include "Swiften/Presence/DirectedPresenceSender.h" -#include "Swiften/Presence/StanzaChannelPresenceSender.h" -#include "Swiften/Avatars/NullAvatarManager.h" -#include "Swift/Controllers/Chat/MUCController.h" -#include "Swift/Controllers/UIInterfaces/ChatWindow.h" -#include "Swift/Controllers/UIInterfaces/ChatWindowFactory.h" -#include "Swiften/Client/NickResolver.h" -#include "Swiften/Roster/XMPPRoster.h" -#include "Swift/Controllers/UIEvents/UIEventStream.h" -#include "Swift/Controllers/UnitTest/MockChatWindow.h" -#include "Swiften/MUC/UnitTest/MockMUC.h" -#include "Swiften/Client/DummyStanzaChannel.h" -#include "Swiften/Queries/DummyIQChannel.h" -#include "Swiften/Presence/PresenceOracle.h" -#include "Swiften/Network/TimerFactory.h" -#include "Swiften/Elements/MUCUserPayload.h" -#include "Swiften/Disco/DummyEntityCapsProvider.h" -#include <Swiften/VCards/VCardMemoryStorage.h> +#include <Swiften/Avatars/NullAvatarManager.h> +#include <Swiften/Base/foreach.h> +#include <Swiften/Client/ClientBlockListManager.h> +#include <Swiften/Client/DummyStanzaChannel.h> +#include <Swiften/Client/NickResolver.h> +#include <Swiften/Crypto/CryptoProvider.h> #include <Swiften/Crypto/PlatformCryptoProvider.h> +#include <Swiften/Disco/DummyEntityCapsProvider.h> +#include <Swiften/Elements/MUCUserPayload.h> +#include <Swiften/MUC/UnitTest/MockMUC.h> +#include <Swiften/Network/TimerFactory.h> +#include <Swiften/Presence/DirectedPresenceSender.h> +#include <Swiften/Presence/PresenceOracle.h> +#include <Swiften/Presence/StanzaChannelPresenceSender.h> +#include <Swiften/Queries/DummyIQChannel.h> +#include <Swiften/Roster/XMPPRoster.h> #include <Swiften/VCards/VCardManager.h> -#include <Swift/Controllers/Settings/DummySettingsProvider.h> +#include <Swiften/VCards/VCardMemoryStorage.h> + #include <Swift/Controllers/Chat/ChatMessageParser.h> +#include <Swift/Controllers/Chat/MUCController.h> #include <Swift/Controllers/Chat/UserSearchController.h> -#include <Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h> -#include <Swift/Controllers/Roster/Roster.h> #include <Swift/Controllers/Roster/GroupRosterItem.h> -#include <Swiften/Crypto/CryptoProvider.h> +#include <Swift/Controllers/Roster/Roster.h> +#include <Swift/Controllers/Settings/DummySettingsProvider.h> +#include <Swift/Controllers/UIEvents/UIEventStream.h> +#include <Swift/Controllers/UIInterfaces/ChatWindow.h> +#include <Swift/Controllers/UIInterfaces/ChatWindowFactory.h> +#include <Swift/Controllers/UIInterfaces/UserSearchWindowFactory.h> +#include <Swift/Controllers/UnitTest/MockChatWindow.h> +#include <Swift/Controllers/XMPPEvents/EventController.h> using namespace Swift; @@ -84,11 +87,13 @@ public: chatMessageParser_ = boost::make_shared<ChatMessageParser>(std::map<std::string, std::string>(), highlightManager_->getRules(), true); vcardStorage_ = new VCardMemoryStorage(crypto_.get()); vcardManager_ = new VCardManager(self_, iqRouter_, vcardStorage_); - controller_ = new MUCController (self_, muc_, boost::optional<std::string>(), nick_, stanzaChannel_, iqRouter_, chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory, eventController_, entityCapsProvider_, NULL, NULL, mucRegistry_, highlightManager_, chatMessageParser_, false, NULL, vcardManager_); + clientBlockListManager_ = new ClientBlockListManager(iqRouter_); + controller_ = new MUCController (self_, muc_, boost::optional<std::string>(), nick_, stanzaChannel_, iqRouter_, chatWindowFactory_, presenceOracle_, avatarManager_, uiEventStream_, false, timerFactory, eventController_, entityCapsProvider_, NULL, NULL, mucRegistry_, highlightManager_, clientBlockListManager_, chatMessageParser_, false, NULL, vcardManager_); } void tearDown() { delete controller_; + delete clientBlockListManager_; delete vcardManager_; delete vcardStorage_; delete highlightManager_; @@ -432,6 +437,7 @@ private: boost::shared_ptr<CryptoProvider> crypto_; VCardManager* vcardManager_; VCardMemoryStorage* vcardStorage_; + ClientBlockListManager* clientBlockListManager_; }; CPPUNIT_TEST_SUITE_REGISTRATION(MUCControllerTest); |