diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-11-03 14:59:35 (GMT) |
|---|---|---|
| committer | Kevin Smith <kevin.smith@isode.com> | 2015-11-06 13:43:05 (GMT) |
| commit | 8f55f01251b99d73291d4deb4311a0e0d1e9e06d (patch) | |
| tree | 768917680b19f898dc8333824c86410b2ebb7180 /Swift | |
| parent | d3d767ba12d88fcb8d16b9a70f95781bacb19bfc (diff) | |
| download | swift-8f55f01251b99d73291d4deb4311a0e0d1e9e06d.zip swift-8f55f01251b99d73291d4deb4311a0e0d1e9e06d.tar.bz2 | |
Making virtual calls in constructor of ChatControllers explicit
Virtual calls in ctors/dtors are tricky as it is not clear
what method is going to be called. By changing the code to
call the explicit method it is obvious.
This issue was raised by Clang Analyzer.
This commit also adds missing SWIFTEN_OVERRIDE annotations.
Test-Information:
Still compiles, tests pass and Clang Analyzer warning so gone.
Change-Id: I8096994277ad32933f992b9a11079c761d3ec619
Diffstat (limited to 'Swift')
| -rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 2 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/ChatController.h | 37 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.cpp | 28 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/ChatControllerBase.h | 26 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/MUCController.cpp | 4 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/MUCController.h | 29 | ||||
| -rw-r--r-- | Swift/Controllers/XMPPEvents/MUCInviteEvent.h | 14 |
7 files changed, 78 insertions, 62 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index 51c7349..503a050 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp @@ -92,19 +92,19 @@ ChatController::ChatController(const JID& self, StanzaChannel* stanzaChannel, IQ chatWindow_->onFileTransferCancel.connect(boost::bind(&ChatController::handleFileTransferCancel, this, _1)); chatWindow_->onSendFileRequest.connect(boost::bind(&ChatController::handleSendFileRequest, this, _1)); chatWindow_->onWhiteboardSessionAccept.connect(boost::bind(&ChatController::handleWhiteboardSessionAccept, this)); chatWindow_->onWhiteboardSessionCancel.connect(boost::bind(&ChatController::handleWhiteboardSessionCancel, this)); chatWindow_->onWhiteboardWindowShow.connect(boost::bind(&ChatController::handleWhiteboardWindowShow, this)); chatWindow_->onBlockUserRequest.connect(boost::bind(&ChatController::handleBlockUserRequest, this)); chatWindow_->onUnblockUserRequest.connect(boost::bind(&ChatController::handleUnblockUserRequest, this)); chatWindow_->onInviteToChat.connect(boost::bind(&ChatController::handleInviteToChat, this, _1)); chatWindow_->onClosed.connect(boost::bind(&ChatController::handleWindowClosed, this)); - handleBareJIDCapsChanged(toJID_); + ChatController::handleBareJIDCapsChanged(toJID_); settings_->onSettingChanged.connect(boost::bind(&ChatController::handleSettingChanged, this, _1)); eventStream_->onUIEvent.connect(boost::bind(&ChatController::handleUIEvent, this, _1)); } void ChatController::handleContactNickChanged(const JID& jid, const std::string& /*oldNick*/) { if (jid.toBare() == toJID_.toBare()) { chatWindow_->setName(nickResolver_->jidToNick(jid)); } diff --git a/Swift/Controllers/Chat/ChatController.h b/Swift/Controllers/Chat/ChatController.h index a1f40be..9ee82eb 100644 --- a/Swift/Controllers/Chat/ChatController.h +++ b/Swift/Controllers/Chat/ChatController.h @@ -3,18 +3,19 @@ * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <map> #include <string> +#include <Swiften/Base/Override.h> #include <Swiften/Base/Tristate.h> #include <Swift/Controllers/Chat/ChatControllerBase.h> #include <Swift/Controllers/UIInterfaces/ChatWindow.h> namespace Swift { class AvatarManager; class ChatStateNotifier; class ChatStateTracker; @@ -25,47 +26,47 @@ namespace Swift { class HistoryController; class HighlightManager; class ClientBlockListManager; class UIEvent; class ChatController : public ChatControllerBase { public: ChatController(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &contact, NickResolver* nickResolver, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool isInMUC, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, bool userWantsReceipts, SettingsProvider* settings, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, boost::shared_ptr<ChatMessageParser> chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider); virtual ~ChatController(); - virtual void setToJID(const JID& jid); - virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info); - virtual void setOnline(bool online); + virtual void setToJID(const JID& jid) SWIFTEN_OVERRIDE; + virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) SWIFTEN_OVERRIDE; + virtual void setOnline(bool online) SWIFTEN_OVERRIDE; virtual void handleNewFileTransferController(FileTransferController* ftc); virtual void handleWhiteboardSessionRequest(bool senderIsSelf); virtual void handleWhiteboardStateChange(const ChatWindow::WhiteboardSessionState state); - virtual void setContactIsReceivingPresence(bool /*isReceivingPresence*/); - virtual ChatWindow* detachChatWindow(); + virtual void setContactIsReceivingPresence(bool /*isReceivingPresence*/) SWIFTEN_OVERRIDE; + virtual ChatWindow* detachChatWindow() SWIFTEN_OVERRIDE; protected: - void cancelReplaces(); - JID getBaseJID(); - void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming); + virtual void cancelReplaces() SWIFTEN_OVERRIDE; + virtual JID getBaseJID() SWIFTEN_OVERRIDE; + virtual void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming) SWIFTEN_OVERRIDE; private: void handlePresenceChange(boost::shared_ptr<Presence> newPresence); std::string getStatusChangeString(boost::shared_ptr<Presence> presence); - bool isIncomingMessageFromMe(boost::shared_ptr<Message> message); - void postSendMessage(const std::string &body, boost::shared_ptr<Stanza> sentStanza); - void preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent); - void postHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent, const HighlightAction&); - void preSendMessageRequest(boost::shared_ptr<Message>); - std::string senderHighlightNameFromMessage(const JID& from); - std::string senderDisplayNameFromMessage(const JID& from); - virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const; + virtual bool isIncomingMessageFromMe(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE; + virtual void postSendMessage(const std::string &body, boost::shared_ptr<Stanza> sentStanza) SWIFTEN_OVERRIDE; + virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent) SWIFTEN_OVERRIDE; + virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent> messageEvent, const HighlightAction&) SWIFTEN_OVERRIDE; + virtual void preSendMessageRequest(boost::shared_ptr<Message>) SWIFTEN_OVERRIDE; + virtual std::string senderHighlightNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; + virtual std::string senderDisplayNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; + virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message>) const SWIFTEN_OVERRIDE; void handleStanzaAcked(boost::shared_ptr<Stanza> stanza); - void dayTicked() {lastWasPresence_ = false;} + virtual void dayTicked() SWIFTEN_OVERRIDE { lastWasPresence_ = false; } void handleContactNickChanged(const JID& jid, const std::string& /*oldNick*/); - void handleBareJIDCapsChanged(const JID& jid); + virtual void handleBareJIDCapsChanged(const JID& jid) SWIFTEN_OVERRIDE; void handleFileTransferCancel(std::string /* id */); void handleFileTransferStart(std::string /* id */, std::string /* description */); void handleFileTransferAccept(std::string /* id */, std::string /* filename */); void handleSendFileRequest(std::string filename); void handleWhiteboardSessionAccept(); void handleWhiteboardSessionCancel(); void handleWhiteboardWindowShow(); diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp index 042ed3a..ae0eed2 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.cpp +++ b/Swift/Controllers/Chat/ChatControllerBase.cpp @@ -1,61 +1,61 @@ /* * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/Controllers/Chat/ChatControllerBase.h> -#include <sstream> #include <map> +#include <sstream> +#include <boost/algorithm/string.hpp> #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/smart_ptr/make_shared.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #include <boost/numeric/conversion/cast.hpp> -#include <boost/algorithm/string.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/smart_ptr/make_shared.hpp> -#include <Swiften/Base/format.h> +#include <Swiften/Avatars/AvatarManager.h> #include <Swiften/Base/Path.h> #include <Swiften/Base/String.h> +#include <Swiften/Base/foreach.h> +#include <Swiften/Base/format.h> #include <Swiften/Client/StanzaChannel.h> +#include <Swiften/Disco/EntityCapsProvider.h> #include <Swiften/Elements/Delay.h> #include <Swiften/Elements/MUCInvitationPayload.h> #include <Swiften/Elements/MUCUserPayload.h> -#include <Swiften/Base/foreach.h> -#include <Swiften/Disco/EntityCapsProvider.h> #include <Swiften/Queries/Requests/GetSecurityLabelsCatalogRequest.h> -#include <Swiften/Avatars/AvatarManager.h> +#include <Swift/Controllers/Chat/AutoAcceptMUCInviteDecider.h> +#include <Swift/Controllers/Chat/ChatMessageParser.h> +#include <Swift/Controllers/HighlightManager.h> +#include <Swift/Controllers/Highlighter.h> #include <Swift/Controllers/Intl.h> -#include <Swift/Controllers/XMPPEvents/EventController.h> #include <Swift/Controllers/UIEvents/JoinMUCUIEvent.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/UIInterfaces/ChatWindow.h> #include <Swift/Controllers/UIInterfaces/ChatWindowFactory.h> +#include <Swift/Controllers/XMPPEvents/EventController.h> #include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h> -#include <Swift/Controllers/HighlightManager.h> -#include <Swift/Controllers/Highlighter.h> -#include <Swift/Controllers/Chat/AutoAcceptMUCInviteDecider.h> -#include <Swift/Controllers/Chat/ChatMessageParser.h> namespace Swift { ChatControllerBase::ChatControllerBase(const JID& self, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, const JID &toJID, PresenceOracle* presenceOracle, AvatarManager* avatarManager, bool useDelayForLatency, UIEventStream* eventStream, EventController* eventController, TimerFactory* timerFactory, EntityCapsProvider* entityCapsProvider, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, boost::shared_ptr<ChatMessageParser> chatMessageParser, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider) : selfJID_(self), stanzaChannel_(stanzaChannel), iqRouter_(iqRouter), chatWindowFactory_(chatWindowFactory), toJID_(toJID), labelsEnabled_(false), presenceOracle_(presenceOracle), avatarManager_(avatarManager), useDelayForLatency_(useDelayForLatency), eventController_(eventController), timerFactory_(timerFactory), entityCapsProvider_(entityCapsProvider), historyController_(historyController), mucRegistry_(mucRegistry), chatMessageParser_(chatMessageParser), autoAcceptMUCInviteDecider_(autoAcceptMUCInviteDecider), eventStream_(eventStream) { chatWindow_ = chatWindowFactory_->createChatWindow(toJID, eventStream); chatWindow_->onAllMessagesRead.connect(boost::bind(&ChatControllerBase::handleAllMessagesRead, this)); chatWindow_->onSendMessageRequest.connect(boost::bind(&ChatControllerBase::handleSendMessageRequest, this, _1, _2)); chatWindow_->onLogCleared.connect(boost::bind(&ChatControllerBase::handleLogCleared, this)); entityCapsProvider_->onCapsChanged.connect(boost::bind(&ChatControllerBase::handleCapsChanged, this, _1)); highlighter_ = highlightManager->createHighlighter(); - setOnline(stanzaChannel->isAvailable() && iqRouter->isAvailable()); + ChatControllerBase::setOnline(stanzaChannel->isAvailable() && iqRouter->isAvailable()); createDayChangeTimer(); } ChatControllerBase::~ChatControllerBase() { delete highlighter_; delete chatWindow_; } void ChatControllerBase::handleLogCleared() { diff --git a/Swift/Controllers/Chat/ChatControllerBase.h b/Swift/Controllers/Chat/ChatControllerBase.h index 6c67985..4e68a2b 100644 --- a/Swift/Controllers/Chat/ChatControllerBase.h +++ b/Swift/Controllers/Chat/ChatControllerBase.h @@ -1,44 +1,44 @@ /* * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <map> -#include <vector> #include <string> +#include <vector> -#include <boost/shared_ptr.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> #include <boost/filesystem/path.hpp> #include <boost/optional.hpp> -#include <boost/date_time/posix_time/posix_time.hpp> +#include <boost/shared_ptr.hpp> -#include <Swiften/Network/Timer.h> -#include <Swiften/Network/TimerFactory.h> -#include <Swiften/Elements/Stanza.h> +#include <Swiften/Base/IDGenerator.h> #include <Swiften/Base/boost_bsignals.h> #include <Swiften/Elements/DiscoInfo.h> -#include <Swiften/JID/JID.h> -#include <Swiften/Elements/SecurityLabelsCatalog.h> #include <Swiften/Elements/ErrorPayload.h> +#include <Swiften/Elements/SecurityLabelsCatalog.h> +#include <Swiften/Elements/Stanza.h> +#include <Swiften/JID/JID.h> +#include <Swiften/MUC/MUCRegistry.h> +#include <Swiften/Network/Timer.h> +#include <Swiften/Network/TimerFactory.h> #include <Swiften/Presence/PresenceOracle.h> #include <Swiften/Queries/IQRouter.h> -#include <Swiften/Base/IDGenerator.h> -#include <Swiften/MUC/MUCRegistry.h> -#include <Swift/Controllers/XMPPEvents/MessageEvent.h> -#include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h> -#include <Swift/Controllers/HistoryController.h> #include <Swift/Controllers/HighlightManager.h> +#include <Swift/Controllers/HistoryController.h> #include <Swift/Controllers/UIInterfaces/ChatWindow.h> +#include <Swift/Controllers/XMPPEvents/MUCInviteEvent.h> +#include <Swift/Controllers/XMPPEvents/MessageEvent.h> namespace Swift { class IQRouter; class StanzaChannel; class ChatWindowFactory; class AvatarManager; class UIEventStream; class EventController; class EntityCapsProvider; diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index 35e79cc..e6c16b7 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -145,24 +145,24 @@ MUCController::MUCController ( muc_->onUnlocked.connect(boost::bind(&MUCController::handleRoomUnlocked, this)); chatWindow_->convertToMUC(ChatWindow::ImpromptuMUC); } else { muc_->onOccupantRoleChanged.connect(boost::bind(&MUCController::handleOccupantRoleChanged, this, _1, _2, _3)); muc_->onOccupantAffiliationChanged.connect(boost::bind(&MUCController::handleOccupantAffiliationChanged, this, _1, _2, _3)); chatWindow_->convertToMUC(ChatWindow::StandardMUC); chatWindow_->setName(muc->getJID().getNode()); } if (stanzaChannel->isAvailable()) { - setOnline(true); + MUCController::setOnline(true); } if (avatarManager_ != NULL) { avatarChangedConnection_ = (avatarManager_->onAvatarChanged.connect(boost::bind(&MUCController::handleAvatarChanged, this, _1))); } - handleBareJIDCapsChanged(muc->getJID()); + MUCController::handleBareJIDCapsChanged(muc->getJID()); eventStream_->onUIEvent.connect(boost::bind(&MUCController::handleUIEvent, this, _1)); // setup handling of MUC bookmark changes mucBookmarkManagerBookmarkAddedConnection_ = (mucBookmarkManager_->onBookmarkAdded.connect(boost::bind(&MUCController::handleMUCBookmarkAdded, this, _1))); mucBookmarkManagerBookmarkRemovedConnection_ = (mucBookmarkManager_->onBookmarkRemoved.connect(boost::bind(&MUCController::handleMUCBookmarkRemoved, this, _1))); std::vector<MUCBookmark> mucBookmarks = mucBookmarkManager_->getBookmarks(); std::vector<MUCBookmark>::iterator bookmarkIterator = std::find_if(mucBookmarks.begin(), mucBookmarks.end(), MUCBookmarkPredicate(muc->getJID())); diff --git a/Swift/Controllers/Chat/MUCController.h b/Swift/Controllers/Chat/MUCController.h index 36edbdd..a08d541 100644 --- a/Swift/Controllers/Chat/MUCController.h +++ b/Swift/Controllers/Chat/MUCController.h @@ -7,18 +7,19 @@ #pragma once #include <map> #include <set> #include <string> #include <boost/shared_ptr.hpp> #include <boost/signals/connection.hpp> +#include <Swiften/Base/Override.h> #include <Swiften/Base/boost_bsignals.h> #include <Swiften/Elements/DiscoInfo.h> #include <Swiften/Elements/MUCOccupant.h> #include <Swiften/Elements/Message.h> #include <Swiften/JID/JID.h> #include <Swiften/MUC/MUC.h> #include <Swiften/Network/Timer.h> #include <Swift/Controllers/Chat/ChatControllerBase.h> @@ -53,43 +54,43 @@ namespace Swift { class MUCController : public ChatControllerBase { public: MUCController(const JID& self, MUC::ref muc, const boost::optional<std::string>& password, const std::string &nick, StanzaChannel* stanzaChannel, IQRouter* iqRouter, ChatWindowFactory* chatWindowFactory, PresenceOracle* presenceOracle, AvatarManager* avatarManager, UIEventStream* events, bool useDelayForLatency, TimerFactory* timerFactory, EventController* eventController, EntityCapsProvider* entityCapsProvider, XMPPRoster* roster, HistoryController* historyController, MUCRegistry* mucRegistry, HighlightManager* highlightManager, ClientBlockListManager* clientBlockListManager, boost::shared_ptr<ChatMessageParser> chatMessageParser, bool isImpromptu, AutoAcceptMUCInviteDecider* autoAcceptMUCInviteDecider, VCardManager* vcardManager, MUCBookmarkManager* mucBookmarkManager); virtual ~MUCController(); boost::signal<void ()> onUserLeft; boost::signal<void ()> onUserJoined; boost::signal<void ()> onImpromptuConfigCompleted; boost::signal<void (const std::string&, const std::string& )> onUserNicknameChanged; - virtual void setOnline(bool online); - virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info); + virtual void setOnline(bool online) SWIFTEN_OVERRIDE; + virtual void setAvailableServerFeatures(boost::shared_ptr<DiscoInfo> info) SWIFTEN_OVERRIDE; void rejoin(); static void appendToJoinParts(std::vector<NickJoinPart>& joinParts, const NickJoinPart& newEvent); static std::string generateJoinPartString(const std::vector<NickJoinPart>& joinParts, bool isImpromptu); static std::string concatenateListOfNames(const std::vector<NickJoinPart>& joinParts); static std::string generateNicknameChangeString(const std::string& oldNickname, const std::string& newNickname); bool isJoined(); const std::string& getNick(); const boost::optional<std::string> getPassword() const; bool isImpromptu() const; std::map<std::string, JID> getParticipantJIDs() const; void sendInvites(const std::vector<JID>& jids, const std::string& reason) const; protected: - void preSendMessageRequest(boost::shared_ptr<Message> message); - bool isIncomingMessageFromMe(boost::shared_ptr<Message> message); - std::string senderHighlightNameFromMessage(const JID& from); - std::string senderDisplayNameFromMessage(const JID& from); - boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message> message) const; - virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent>); - virtual void addMessageHandleIncomingMessage(const JID& from, const std::string& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time, const HighlightAction& highlight); - virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent>, const HighlightAction&); - void cancelReplaces(); - void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming); + virtual void preSendMessageRequest(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE; + virtual bool isIncomingMessageFromMe(boost::shared_ptr<Message> message) SWIFTEN_OVERRIDE; + virtual std::string senderHighlightNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; + virtual std::string senderDisplayNameFromMessage(const JID& from) SWIFTEN_OVERRIDE; + virtual boost::optional<boost::posix_time::ptime> getMessageTimestamp(boost::shared_ptr<Message> message) const SWIFTEN_OVERRIDE; + virtual void preHandleIncomingMessage(boost::shared_ptr<MessageEvent>) SWIFTEN_OVERRIDE; + virtual void addMessageHandleIncomingMessage(const JID& from, const std::string& message, bool senderIsSelf, boost::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time, const HighlightAction& highlight) SWIFTEN_OVERRIDE; + virtual void postHandleIncomingMessage(boost::shared_ptr<MessageEvent>, const HighlightAction&) SWIFTEN_OVERRIDE; + virtual void cancelReplaces() SWIFTEN_OVERRIDE; + virtual void logMessage(const std::string& message, const JID& fromJID, const JID& toJID, const boost::posix_time::ptime& timeStamp, bool isIncoming) SWIFTEN_OVERRIDE; private: void setAvailableRoomActions(const MUCOccupant::Affiliation& affiliation, const MUCOccupant::Role& role); void clearPresenceQueue(); void addPresenceMessage(const std::string& message); void handleWindowOccupantSelectionChanged(ContactRosterItem* item); void handleActionRequestedOnOccupant(ChatWindow::OccupantAction, ContactRosterItem* item); void handleWindowClosed(); void handleAvatarChanged(const JID& jid); @@ -106,21 +107,21 @@ namespace Swift { void handleBookmarkRequest(); std::string roleToGroupName(MUCOccupant::Role role); std::string roleToSortName(MUCOccupant::Role role); JID nickToJID(const std::string& nick); std::string roleToFriendlyName(MUCOccupant::Role role); void receivedActivity(); bool messageTargetsMe(boost::shared_ptr<Message> message); void updateJoinParts(); bool shouldUpdateJoinParts(); - void dayTicked() {clearPresenceQueue();} + virtual void dayTicked() SWIFTEN_OVERRIDE { clearPresenceQueue(); } void processUserPart(); - void handleBareJIDCapsChanged(const JID& jid); + virtual void handleBareJIDCapsChanged(const JID& jid) SWIFTEN_OVERRIDE; void handleConfigureRequest(Form::ref); void handleConfigurationFailed(ErrorPayload::ref); void handleConfigurationFormReceived(Form::ref); void handleDestroyRoomRequest(); void handleInvitePersonToThisMUCRequest(const std::vector<JID>& jidsToInvite); void handleConfigurationCancelled(); void handleOccupantRoleChangeFailed(ErrorPayload::ref, const JID&, MUCOccupant::Role); void handleGetAffiliationsRequest(); void handleAffiliationListReceived(MUCOccupant::Affiliation affiliation, const std::vector<JID>& jids); diff --git a/Swift/Controllers/XMPPEvents/MUCInviteEvent.h b/Swift/Controllers/XMPPEvents/MUCInviteEvent.h index 65ecece..1ae9891 100644 --- a/Swift/Controllers/XMPPEvents/MUCInviteEvent.h +++ b/Swift/Controllers/XMPPEvents/MUCInviteEvent.h @@ -1,17 +1,31 @@ /* * Copyright (c) 2012 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once +#include <string> + +#include <boost/shared_ptr.hpp> + +#include <Swiften/JID/JID.h> + +#include <Swift/Controllers/XMPPEvents/StanzaEvent.h> + namespace Swift { class MUCInviteEvent : public StanzaEvent { public: typedef boost::shared_ptr<MUCInviteEvent> ref; public: MUCInviteEvent(const JID& inviter, const JID& roomJID, const std::string& reason, const std::string& password, bool direct, bool impromptu) : inviter_(inviter), roomJID_(roomJID), reason_(reason), password_(password), direct_(direct), impromptu_(impromptu) {} |
Swift