summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Chat')
-rw-r--r--Swift/Controllers/Chat/UserSearchController.cpp12
-rw-r--r--Swift/Controllers/Chat/UserSearchController.h3
2 files changed, 13 insertions, 2 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);