diff options
Diffstat (limited to 'Swift/Controllers/Chat/UserSearchController.cpp')
-rw-r--r-- | Swift/Controllers/Chat/UserSearchController.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index 53898a1..24f3724 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -62,13 +62,15 @@ UserSearchWindow* UserSearchController::getUserSearchWindow() { } void UserSearchController::setCanInitiateImpromptuMUC(bool supportsImpromptu) { if (!window_) { initializeUserWindow(); } - window_->setCanStartImpromptuChats(supportsImpromptu); + if (window_) { + window_->setCanStartImpromptuChats(supportsImpromptu); + } // Else doesn't support search } void UserSearchController::handleUIEvent(boost::shared_ptr<UIEvent> event) { bool handle = false; boost::shared_ptr<RequestAddUserDialogUIEvent> addUserRequest = boost::shared_ptr<RequestAddUserDialogUIEvent>(); RequestInviteToMUCUIEvent::ref inviteToMUCRequest = RequestInviteToMUCUIEvent::ref(); @@ -320,12 +322,16 @@ void UserSearchController::initializeUserWindow() { case InviteToChat: windowType = UserSearchWindow::InviteToChat; break; } window_ = factory_->createUserSearchWindow(windowType, uiEventStream_, rosterController_->getGroups()); + if (!window_) { + // UI Doesn't support user search + return; + } window_->onNameSuggestionRequested.connect(boost::bind(&UserSearchController::handleNameSuggestionRequest, this, _1)); window_->onFormRequested.connect(boost::bind(&UserSearchController::handleFormRequested, this, _1)); 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)); |