From 39f291afd3cab9d6c1e7cdf7f0f5476ef6747abd Mon Sep 17 00:00:00 2001
From: Tobias Markmann <tm@ayena.de>
Date: Wed, 30 Sep 2015 17:53:32 +0100
Subject: Fix crash in user search dialog for invitation use case

Commit 9b48a73 introduced a bug because it always assumed
the 'Add contact' user case.

Test-Information:

Retested the add contact case described in commit 9b48a73 and
tested MUC invitation by DND. Neither crashes anymore.

Change-Id: Ifab356e6ad9a52365ed15dd46e4e94492bdc60bf

diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 013b869..bb6fc31 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -304,7 +304,9 @@ void QtUserSearchWindow::handleOnSearchedJIDSelected(const Contact::ref& contact
 
 void QtUserSearchWindow::show() {
 	clear();
-	setWarning(boost::optional<std::string>());
+	if (type_ == AddContact) {
+		setWarning(boost::optional<std::string>());
+	}
 	QWidget::show();
 }
 
-- 
cgit v0.10.2-6-g49f6