diff options
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/Chat/UserSearchController.cpp | 12 | ||||
-rw-r--r-- | Swift/Controllers/Chat/UserSearchController.h | 3 | ||||
-rw-r--r-- | Swift/Controllers/UIInterfaces/UserSearchWindow.h | 4 |
3 files changed, 16 insertions, 3 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index 3c7eb67..7844c1b 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -45,6 +45,7 @@ UserSearchController::~UserSearchController() { window_->onFormRequested.disconnect(boost::bind(&UserSearchController::handleFormRequested, this, _1)); window_->onSearchRequested.disconnect(boost::bind(&UserSearchController::handleSearch, this, _1, _2)); window_->onJIDUpdateRequested.disconnect(boost::bind(&UserSearchController::handleJIDUpdateRequested, this, _1)); + window_->onJIDAddRequested.disconnect(boost::bind(&UserSearchController::handleJIDAddRequested, this, _1)); delete window_; } presenceOracle_->onPresenceChange.disconnect(boost::bind(&UserSearchController::handlePresenceChanged, this, _1)); @@ -222,6 +223,14 @@ void UserSearchController::handleJIDUpdateRequested(const std::vector<JID>& jids } } +void UserSearchController::handleJIDAddRequested(const std::vector<JID>& jids) { + std::vector<Contact> contacts; + foreach(const JID& jid, jids) { + contacts.push_back(convertJIDtoContact(jid)); + } + window_->addContacts(contacts); +} + Contact UserSearchController::convertJIDtoContact(const JID& jid) { Contact contact; contact.jid = jid; @@ -278,6 +287,7 @@ void UserSearchController::initializeUserWindow() { window_->onSearchRequested.connect(boost::bind(&UserSearchController::handleSearch, this, _1, _2)); window_->onContactSuggestionsRequested.connect(boost::bind(&UserSearchController::handleContactSuggestionsRequested, this, _1)); window_->onJIDUpdateRequested.connect(boost::bind(&UserSearchController::handleJIDUpdateRequested, this, _1)); + window_->onJIDAddRequested.connect(boost::bind(&UserSearchController::handleJIDAddRequested, this, _1)); window_->setSelectedService(JID(jid_.getDomain())); window_->clear(); } diff --git a/Swift/Controllers/Chat/UserSearchController.h b/Swift/Controllers/Chat/UserSearchController.h index 21cad5e..fc4c8e9 100644 --- a/Swift/Controllers/Chat/UserSearchController.h +++ b/Swift/Controllers/Chat/UserSearchController.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -67,6 +67,7 @@ namespace Swift { void handleAvatarChanged(const JID& jid); void handlePresenceChanged(Presence::ref presence); void handleJIDUpdateRequested(const std::vector<JID>& jids); + void handleJIDAddRequested(const std::vector<JID>& jids); Contact convertJIDtoContact(const JID& jid); void endDiscoWalker(); void initializeUserWindow(); diff --git a/Swift/Controllers/UIInterfaces/UserSearchWindow.h b/Swift/Controllers/UIInterfaces/UserSearchWindow.h index 9dd1811..0245f34 100644 --- a/Swift/Controllers/UIInterfaces/UserSearchWindow.h +++ b/Swift/Controllers/UIInterfaces/UserSearchWindow.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -39,6 +39,7 @@ namespace Swift { virtual std::vector<JID> getJIDs() const = 0; virtual void setCanStartImpromptuChats(bool supportsImpromptu) = 0; virtual void updateContacts(const std::vector<Contact>& contacts) = 0; + virtual void addContacts(const std::vector<Contact>& contacts) = 0; virtual void show() = 0; @@ -47,5 +48,6 @@ namespace Swift { boost::signal<void (const JID&)> onNameSuggestionRequested; boost::signal<void (const std::string&)> onContactSuggestionsRequested; boost::signal<void (const std::vector<JID>&)> onJIDUpdateRequested; + boost::signal<void (const std::vector<JID>&)> onJIDAddRequested; }; } |