summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-07-23 08:00:01 (GMT)
committerSwift Review <review@swift.im>2014-10-03 07:21:38 (GMT)
commit3742d8fe17f558f9f6a5e26ac10e5ec3f0c3ae6c (patch)
tree0135a5e6aef5e1e9b5f389cdb8f14406765df029 /Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
parent4a4e72be24c9b7789426adf5cae078bfc4ca424e (diff)
downloadswift-3742d8fe17f558f9f6a5e26ac10e5ec3f0c3ae6c.zip
swift-3742d8fe17f558f9f6a5e26ac10e5ec3f0c3ae6c.tar.bz2
Suggest MUC occupants when typing in highlight editor JID box
Test-Information: Join several MUCs and confirm that MUC occupants are suggested along with recent contacts. Confirm that clicking or pressing return adds the selected contact to the edit field. Check that QtSuggestingJIDInput in Start Chat dialog still functions as before, and that MUC users are not suggested here. Change-Id: Ieadc95d55c764e1fa48c949cca4d5e0aa5f19615
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchWindow.cpp')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchWindow.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
index 17214e4..e5bd5d0 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp
@@ -78,7 +78,7 @@ void QtUserSearchWindow::handleCurrentChanged(int page) {
}
resultsPage_->emitCompletenessCheck();
if (page == 1 && lastPage_ == 3) {
- addSearchedJIDToList(getContactJID());
+ addSearchedJIDToList(getContact());
setSecondPage();
}
else if (page == 2 && lastPage_ == 1) {
@@ -270,9 +270,13 @@ JID QtUserSearchWindow::getContactJID() const {
return jid;
}
-void QtUserSearchWindow::addSearchedJIDToList(const JID& jid) {
+Contact::ref QtUserSearchWindow::getContact() const {
+ return boost::make_shared<Contact>("", getContactJID(), StatusShow::None, "");
+}
+
+void QtUserSearchWindow::addSearchedJIDToList(const Contact::ref& contact) {
std::vector<JID> jids;
- jids.push_back(jid);
+ jids.push_back(contact->jid);
handleJIDsAdded(jids);
firstMultiJIDPage_->jid_->clear();
}
@@ -343,7 +347,7 @@ void QtUserSearchWindow::setContactSuggestions(const std::vector<Contact::ref>&
void QtUserSearchWindow::setJIDs(const std::vector<JID> &jids) {
foreach(JID jid, jids) {
- addSearchedJIDToList(jid);
+ addSearchedJIDToList(boost::make_shared<Contact>("", jid, StatusShow::None, ""));
}
onJIDUpdateRequested(jids);
}