diff options
Diffstat (limited to 'Swift/Controllers/Chat/UserSearchController.cpp')
-rw-r--r-- | Swift/Controllers/Chat/UserSearchController.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index af962e9..47d57d4 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -46,8 +46,9 @@ UserSearchController::~UserSearchController() { void UserSearchController::handleUIEvent(boost::shared_ptr<UIEvent> event) { bool handle = false; + boost::shared_ptr<RequestAddUserDialogUIEvent> request = boost::shared_ptr<RequestAddUserDialogUIEvent>(); if (type_ == AddContact) { - if (boost::dynamic_pointer_cast<RequestAddUserDialogUIEvent>(event)) { + if (request = boost::dynamic_pointer_cast<RequestAddUserDialogUIEvent>(event)) { handle = true; } } else { @@ -65,6 +66,13 @@ void UserSearchController::handleUIEvent(boost::shared_ptr<UIEvent> event) { window_->clear(); } window_->show(); + if (request) { + const std::string& name = request->getPredefinedName(); + const JID& jid = request->getPredefinedJID(); + if (!name.empty() && jid.isValid()) { + window_->prepopulateJIDAndName(jid, name); + } + } return; } } |