summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-09-15 15:30:48 (GMT)
committerSwift Review <review@swift.im>2015-10-16 14:13:30 (GMT)
commit8da6e35afab55d7232d47575faea2bde7cd44ece (patch)
tree3467ab34d5e1f97c2487c557ce43e14c459219ea /Swift
parentf3279c4497e80bd9497a1e2b834b1921dbf21d86 (diff)
downloadswift-8da6e35afab55d7232d47575faea2bde7cd44ece.zip
swift-8da6e35afab55d7232d47575faea2bde7cd44ece.tar.bz2
Require a node-part for JIDs entered in 'Add contact…'-dialog
While it is possible to add domain only JIDs to a user's roster this is rarely the intention of a user. This patch adds the requirement of a node-part for the address entered in the dialog and presents a warning if the node-part is missing. Test-Information: Verified that a warning triangle is shown if there is no node-part in the user entered address. Change-Id: I38dd0b34ca7cb19b38bb7e1c457f7a8a9ef84028
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/Chat/UserSearchController.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp
index ece897f..454a110 100644
--- a/Swift/Controllers/Chat/UserSearchController.cpp
+++ b/Swift/Controllers/Chat/UserSearchController.cpp
@@ -208,11 +208,15 @@ void UserSearchController::handleNameSuggestionRequest(const JID &jid) {
208 208
209void UserSearchController::handleJIDEditingFinished(const JID& jid) { 209void UserSearchController::handleJIDEditingFinished(const JID& jid) {
210 if (jid.isValid()) { 210 if (jid.isValid()) {
211 if (rosterController_->getItem(jid)) { 211 if (rosterController_->getItem(jid)) {
212 window_->setWarning(QT_TRANSLATE_NOOP("", "This contact is already on your contact list.")); 212 window_->setWarning(QT_TRANSLATE_NOOP("", "This contact is already on your contact list."));
213 } else { 213 }
214 else if (jid.getNode().empty()) {
215 window_->setWarning(QT_TRANSLATE_NOOP("", "Part of the address you have entered is missing. An address has a structure of 'user@example.com'."));
216 }
217 else {
214 window_->setWarning(boost::optional<std::string>()); 218 window_->setWarning(boost::optional<std::string>());
215 } 219 }
216 } 220 }
217 else { 221 else {
218 window_->setWarning(QT_TRANSLATE_NOOP("", "The address you have entered is invalid.")); 222 window_->setWarning(QT_TRANSLATE_NOOP("", "The address you have entered is invalid."));