diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-05-07 18:45:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-05-07 18:45:47 (GMT) |
commit | 203ca1c122db89c4a9f9f01bff2cadb3b9daca04 (patch) | |
tree | e57d7f5997aad1832146d2806418b184e1dfe6bb /Swift/Controllers | |
parent | 61620db053088fac637799b27f04efa44d0bcc6b (diff) | |
download | swift-contrib-203ca1c122db89c4a9f9f01bff2cadb3b9daca04.zip swift-contrib-203ca1c122db89c4a9f9f01bff2cadb3b9daca04.tar.bz2 |
Cleaned up MUC code.
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.cpp | 10 | ||||
-rw-r--r-- | Swift/Controllers/Chat/ChatsManager.h | 4 | ||||
-rw-r--r-- | Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h | 7 | ||||
-rw-r--r-- | Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h | 12 | ||||
-rw-r--r-- | Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h | 7 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/ChatListWindow.h | 4 |
6 files changed, 24 insertions, 20 deletions
diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp index a4ade48..69184ad 100644 --- a/Swift/Controllers/Chat/ChatsManager.cpp +++ b/Swift/Controllers/Chat/ChatsManager.cpp @@ -57,16 +57,16 @@ ChatsManager::~ChatsManager() { delete mucBookmarkManager_; } -void ChatsManager::handleMUCBookmarkAdded(boost::shared_ptr<MUCBookmark> bookmark) { - std::map<JID, MUCController*>::iterator it = mucControllers_.find(bookmark->getRoom()); - if (it == mucControllers_.end() && bookmark->getAutojoin()) { +void ChatsManager::handleMUCBookmarkAdded(const MUCBookmark& bookmark) { + std::map<JID, MUCController*>::iterator it = mucControllers_.find(bookmark.getRoom()); + if (it == mucControllers_.end() && bookmark.getAutojoin()) { //FIXME: need vcard stuff here to get a nick - handleJoinMUCRequest(bookmark->getRoom(), bookmark->getNick()); + handleJoinMUCRequest(bookmark.getRoom(), bookmark.getNick()); } chatListWindow_->addMUCBookmark(bookmark); } -void ChatsManager::handleMUCBookmarkRemoved(boost::shared_ptr<MUCBookmark> bookmark) { +void ChatsManager::handleMUCBookmarkRemoved(const MUCBookmark& bookmark) { chatListWindow_->removeMUCBookmark(bookmark); } diff --git a/Swift/Controllers/Chat/ChatsManager.h b/Swift/Controllers/Chat/ChatsManager.h index 59d4ec3..1f0f203 100644 --- a/Swift/Controllers/Chat/ChatsManager.h +++ b/Swift/Controllers/Chat/ChatsManager.h @@ -48,8 +48,8 @@ namespace Swift { void rebindControllerJID(const JID& from, const JID& to); void handlePresenceChange(boost::shared_ptr<Presence> newPresence, boost::shared_ptr<Presence> lastPresence); void handleUIEvent(boost::shared_ptr<UIEvent> event); - void handleMUCBookmarkAdded(boost::shared_ptr<MUCBookmark> bookmark); - void handleMUCBookmarkRemoved(boost::shared_ptr<MUCBookmark> bookmark); + void handleMUCBookmarkAdded(const MUCBookmark& bookmark); + void handleMUCBookmarkRemoved(const MUCBookmark& bookmark); void handleUserLeftMUC(MUCController* mucController); ChatController* getChatControllerOrFindAnother(const JID &contact); ChatController* createNewChatController(const JID &contact); diff --git a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h index 715798b..210da3e 100644 --- a/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/AddMUCBookmarkUIEvent.h @@ -14,9 +14,10 @@ namespace Swift { class AddMUCBookmarkUIEvent : public UIEvent { public: - AddMUCBookmarkUIEvent(const boost::shared_ptr<MUCBookmark> bookmark) : bookmark_(bookmark) {}; - boost::shared_ptr<MUCBookmark> getBookmark() {return bookmark_;}; + AddMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {}; + const MUCBookmark& getBookmark() { return bookmark; } + private: - boost::shared_ptr<MUCBookmark> bookmark_; + MUCBookmark bookmark; }; } diff --git a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h index bcbcb76..2b10f09 100644 --- a/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/EditMUCBookmarkUIEvent.h @@ -14,11 +14,13 @@ namespace Swift { class EditMUCBookmarkUIEvent : public UIEvent { public: - EditMUCBookmarkUIEvent(const boost::shared_ptr<MUCBookmark> oldBookmark, const boost::shared_ptr<MUCBookmark> newBookmark) : oldBookmark_(oldBookmark) , newBookmark_(newBookmark) {}; - boost::shared_ptr<MUCBookmark> getOldBookmark() {return oldBookmark_;}; - boost::shared_ptr<MUCBookmark> getNewBookmark() {return newBookmark_;}; + EditMUCBookmarkUIEvent(const MUCBookmark& oldBookmark, const MUCBookmark& newBookmark) : oldBookmark(oldBookmark) , newBookmark(newBookmark) {}; + + const MUCBookmark& getOldBookmark() {return oldBookmark;}; + const MUCBookmark& getNewBookmark() {return newBookmark;}; + private: - boost::shared_ptr<MUCBookmark> oldBookmark_; - boost::shared_ptr<MUCBookmark> newBookmark_; + MUCBookmark oldBookmark; + MUCBookmark newBookmark; }; } diff --git a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h index 4a59b2c..ea2e609 100644 --- a/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h +++ b/Swift/Controllers/UIEvents/RemoveMUCBookmarkUIEvent.h @@ -14,9 +14,10 @@ namespace Swift { class RemoveMUCBookmarkUIEvent : public UIEvent { public: - RemoveMUCBookmarkUIEvent(const boost::shared_ptr<MUCBookmark> bookmark) : bookmark_(bookmark) {}; - boost::shared_ptr<MUCBookmark> getBookmark() {return bookmark_;}; + RemoveMUCBookmarkUIEvent(const MUCBookmark& bookmark) : bookmark(bookmark) {}; + const MUCBookmark& getBookmark() { return bookmark; } + private: - boost::shared_ptr<MUCBookmark> bookmark_; + MUCBookmark bookmark; }; } diff --git a/Swift/Controllers/UIInterfaces/ChatListWindow.h b/Swift/Controllers/UIInterfaces/ChatListWindow.h index 6a0762b..fd176a6 100644 --- a/Swift/Controllers/UIInterfaces/ChatListWindow.h +++ b/Swift/Controllers/UIInterfaces/ChatListWindow.h @@ -15,7 +15,7 @@ namespace Swift { public: virtual ~ChatListWindow(); - virtual void addMUCBookmark(boost::shared_ptr<MUCBookmark> bookmark) = 0; - virtual void removeMUCBookmark(boost::shared_ptr<MUCBookmark> bookmark) = 0; + virtual void addMUCBookmark(const MUCBookmark& bookmark) = 0; + virtual void removeMUCBookmark(const MUCBookmark& bookmark) = 0; }; } |