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,3 +1,3 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. @@ -47,2 +47,3 @@ UserSearchController::~UserSearchController() { window_->onJIDUpdateRequested.disconnect(boost::bind(&UserSearchController::handleJIDUpdateRequested, this, _1)); + window_->onJIDAddRequested.disconnect(boost::bind(&UserSearchController::handleJIDAddRequested, this, _1)); delete window_; @@ -224,2 +225,10 @@ 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) { @@ -280,2 +289,3 @@ void UserSearchController::initializeUserWindow() { window_->onJIDUpdateRequested.connect(boost::bind(&UserSearchController::handleJIDUpdateRequested, this, _1)); + window_->onJIDAddRequested.connect(boost::bind(&UserSearchController::handleJIDAddRequested, this, _1)); window_->setSelectedService(JID(jid_.getDomain())); 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,3 +1,3 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. @@ -69,2 +69,3 @@ namespace Swift { void handleJIDUpdateRequested(const std::vector<JID>& jids); + void handleJIDAddRequested(const std::vector<JID>& jids); Contact convertJIDtoContact(const JID& jid); 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,3 +1,3 @@ /* - * Copyright (c) 2010 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. @@ -41,2 +41,3 @@ namespace Swift { virtual void updateContacts(const std::vector<Contact>& contacts) = 0; + virtual void addContacts(const std::vector<Contact>& contacts) = 0; @@ -49,2 +50,3 @@ namespace Swift { boost::signal<void (const std::vector<JID>&)> onJIDUpdateRequested; + boost::signal<void (const std::vector<JID>&)> onJIDAddRequested; }; |
Swift