diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-23 08:00:01 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-10-03 07:21:38 (GMT) |
commit | 3742d8fe17f558f9f6a5e26ac10e5ec3f0c3ae6c (patch) | |
tree | 0135a5e6aef5e1e9b5f389cdb8f14406765df029 /Swift/QtUI/QtHighlightEditor.cpp | |
parent | 4a4e72be24c9b7789426adf5cae078bfc4ca424e (diff) | |
download | swift-contrib-3742d8fe17f558f9f6a5e26ac10e5ec3f0c3ae6c.zip swift-contrib-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/QtHighlightEditor.cpp')
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp index 5aa4560..97774be 100644 --- a/Swift/QtUI/QtHighlightEditor.cpp +++ b/Swift/QtUI/QtHighlightEditor.cpp @@ -351,7 +351,11 @@ void QtHighlightEditor::selectSoundFile() } -void QtHighlightEditor::handleOnUserSelected(const JID& jid) { +void QtHighlightEditor::handleOnUserSelected(const Contact::ref& contact) { /* this might seem like it should be standard behaviour for the suggesting input box, but is not desirable in all cases */ - jid_->setText(P2QSTRING(jid.toString())); + if (contact->jid.isValid()) { + jid_->setText(P2QSTRING(contact->jid.toString())); + } else { + jid_->setText(P2QSTRING(contact->name)); + } } |