diff options
| author | Richard Maudsley <richard.maudsley@isode.com> | 2014-04-15 14:49:05 (GMT) |
|---|---|---|
| committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-04-25 08:38:30 (GMT) |
| commit | b42a5c5849813fe8db3bd3889378a53238cc36f7 (patch) | |
| tree | 2c9265025c0281acfde3077d884e17c834400358 /Swift | |
| parent | d5f701fdd6826421c0c83b8e299918065b6c99d1 (diff) | |
| download | swift-contrib-b42a5c5849813fe8db3bd3889378a53238cc36f7.zip swift-contrib-b42a5c5849813fe8db3bd3889378a53238cc36f7.tar.bz2 | |
Hide reason field in impromptu chat invites.
Change-Id: Icb5075f85a23fc181ff8f5ee00633bb768c4eb5f
Diffstat (limited to 'Swift')
| -rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 4 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/MUCController.cpp | 5 | ||||
| -rw-r--r-- | Swift/Controllers/Chat/UserSearchController.cpp | 1 | ||||
| -rw-r--r-- | Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h | 19 | ||||
| -rw-r--r-- | Swift/Controllers/UIInterfaces/UserSearchWindow.h | 1 | ||||
| -rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 5 | ||||
| -rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.h | 1 |
7 files changed, 31 insertions, 5 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index fb69366..10cf54b 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp @@ -1,37 +1,37 @@ /* - * Copyright (c) 2010-2013 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include <Swift/Controllers/Chat/ChatController.h> #include <boost/bind.hpp> #include <boost/smart_ptr/make_shared.hpp> #include <stdio.h> #include <Swiften/Base/format.h> #include <Swiften/Base/Algorithm.h> #include <Swiften/Avatars/AvatarManager.h> #include <Swiften/Chat/ChatStateNotifier.h> #include <Swiften/Chat/ChatStateTracker.h> #include <Swiften/Client/StanzaChannel.h> #include <Swiften/Client/NickResolver.h> #include <Swiften/Disco/EntityCapsProvider.h> #include <Swiften/Base/foreach.h> #include <Swiften/Base/DateTime.h> #include <Swiften/Elements/DeliveryReceipt.h> #include <Swiften/Elements/DeliveryReceiptRequest.h> #include <Swiften/Elements/Idle.h> #include <Swiften/Base/Log.h> #include <Swiften/Client/ClientBlockListManager.h> #include <Swift/Controllers/Intl.h> #include <Swift/Controllers/UIInterfaces/ChatWindowFactory.h> #include <Swift/Controllers/XMPPEvents/EventController.h> #include <Swift/Controllers/FileTransfer/FileTransferController.h> #include <Swift/Controllers/StatusUtil.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> #include <Swift/Controllers/UIEvents/SendFileUIEvent.h> #include <Swift/Controllers/UIEvents/AcceptWhiteboardSessionUIEvent.h> #include <Swift/Controllers/UIEvents/CancelWhiteboardSessionUIEvent.h> @@ -264,71 +264,71 @@ void ChatController::handleBlockingStateChanged() { void ChatController::handleBlockingItemAdded(const JID& jid) { if (toJID_ == (isInMUC_ ? jid: jid.toBare())) { chatWindow_->setAlert(QT_TRANSLATE_NOOP("", "You've currently blocked this contact. To continue your conversation you have to unblock the contact first.")); chatWindow_->setInputEnabled(false); chatWindow_->setBlockingState(ChatWindow::IsBlocked); } } void ChatController::handleBlockingItemRemoved(const JID& jid) { if (toJID_ == (isInMUC_ ? jid: jid.toBare())) { // FIXME: Support for different types of alerts. chatWindow_->cancelAlert(); chatWindow_->setInputEnabled(true); chatWindow_->setBlockingState(ChatWindow::IsUnblocked); } } void ChatController::handleBlockUserRequest() { if (isInMUC_) { eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, toJID_)); } else { eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Blocked, toJID_.toBare())); } } void ChatController::handleUnblockUserRequest() { if (isInMUC_) { eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_)); } else { eventStream_->send(boost::make_shared<RequestChangeBlockStateUIEvent>(RequestChangeBlockStateUIEvent::Unblocked, toJID_.toBare())); } } void ChatController::handleInviteToChat(const std::vector<JID>& droppedJIDs) { - boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(toJID_.toBare(), droppedJIDs)); + boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(toJID_.toBare(), droppedJIDs, RequestInviteToMUCUIEvent::Impromptu)); eventStream_->send(event); } void ChatController::handleUIEvent(boost::shared_ptr<UIEvent> event) { boost::shared_ptr<InviteToMUCUIEvent> inviteEvent = boost::dynamic_pointer_cast<InviteToMUCUIEvent>(event); if (inviteEvent && inviteEvent->getRoom() == toJID_.toBare()) { onConvertToMUC(detachChatWindow(), inviteEvent->getInvites(), inviteEvent->getReason()); } } void ChatController::postSendMessage(const std::string& body, boost::shared_ptr<Stanza> sentStanza) { boost::shared_ptr<Replace> replace = sentStanza->getPayload<Replace>(); if (replace) { eraseIf(unackedStanzas_, PairSecondEquals<boost::shared_ptr<Stanza>, std::string>(myLastMessageUIID_)); replaceMessage(body, myLastMessageUIID_, boost::posix_time::microsec_clock::universal_time(), HighlightAction()); } else { myLastMessageUIID_ = addMessage(body, QT_TRANSLATE_NOOP("", "me"), true, labelsEnabled_ ? chatWindow_->getSelectedSecurityLabel().getLabel() : boost::shared_ptr<SecurityLabel>(), avatarManager_->getAvatarPath(selfJID_), boost::posix_time::microsec_clock::universal_time(), HighlightAction()); } if (stanzaChannel_->getStreamManagementEnabled() && !myLastMessageUIID_.empty() ) { chatWindow_->setAckState(myLastMessageUIID_, ChatWindow::Pending); unackedStanzas_[sentStanza] = myLastMessageUIID_; } if (sentStanza->getPayload<DeliveryReceiptRequest>()) { requestedReceipts_[sentStanza->getID()] = myLastMessageUIID_; chatWindow_->setMessageReceiptState(myLastMessageUIID_, ChatWindow::ReceiptRequested); } lastWasPresence_ = false; chatStateNotifier_->userSentMessage(); } void ChatController::handleStanzaAcked(boost::shared_ptr<Stanza> stanza) { diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index f83a772..df99368 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -1,37 +1,37 @@ /* - * Copyright (c) 2010-2013 Kevin Smith + * Copyright (c) 2010-2014 Kevin Smith * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include <Swift/Controllers/Chat/MUCController.h> #include <boost/bind.hpp> #include <boost/regex.hpp> #include <boost/algorithm/string.hpp> #include <Swiften/Avatars/AvatarManager.h> #include <Swiften/Base/foreach.h> #include <Swiften/Base/foreach.h> #include <Swiften/Base/format.h> #include <Swiften/Base/Log.h> #include <Swiften/Client/StanzaChannel.h> #include <Swiften/Disco/EntityCapsProvider.h> #include <Swiften/Elements/Delay.h> #include <Swiften/MUC/MUC.h> #include <Swiften/Network/Timer.h> #include <Swiften/Network/TimerFactory.h> #include <Swiften/Roster/XMPPRoster.h> #include <SwifTools/TabComplete.h> #include <Swift/Controllers/Chat/ChatMessageParser.h> #include <Swift/Controllers/Highlighter.h> #include <Swift/Controllers/Intl.h> #include <Swift/Controllers/Roster/ContactRosterItem.h> #include <Swift/Controllers/Roster/GroupRosterItem.h> #include <Swift/Controllers/Roster/ItemOperations/SetAvatar.h> #include <Swift/Controllers/Roster/ItemOperations/SetPresence.h> #include <Swift/Controllers/Roster/ItemOperations/SetMUC.h> #include <Swift/Controllers/Roster/Roster.h> #include <Swift/Controllers/Roster/RosterVCardProvider.h> @@ -813,71 +813,72 @@ void MUCController::handleConfigurationFailed(ErrorPayload::ref error) { errorMessage = str(format(QT_TRANSLATE_NOOP("", "Room configuration failed: %1%.")) % errorMessage); chatWindow_->addErrorMessage(chatMessageParser_->parseMessageBody(errorMessage)); } void MUCController::handleOccupantRoleChangeFailed(ErrorPayload::ref error, const JID&, MUCOccupant::Role) { std::string errorMessage = getErrorMessage(error); errorMessage = str(format(QT_TRANSLATE_NOOP("", "Occupant role change failed: %1%.")) % errorMessage); chatWindow_->addErrorMessage(chatMessageParser_->parseMessageBody(errorMessage)); } void MUCController::configureAsImpromptuRoom(Form::ref form) { muc_->configureRoom(buildImpromptuRoomConfiguration(form)); isImpromptuAlreadyConfigured_ = true; onImpromptuConfigCompleted(); } void MUCController::handleConfigurationFormReceived(Form::ref form) { if (isImpromptu_) { if (!isImpromptuAlreadyConfigured_) { configureAsImpromptuRoom(form); } } else { chatWindow_->showRoomConfigurationForm(form); } } void MUCController::handleConfigurationCancelled() { muc_->cancelConfigureRoom(); } void MUCController::handleDestroyRoomRequest() { muc_->destroyRoom(); } void MUCController::handleInvitePersonToThisMUCRequest(const std::vector<JID>& jidsToInvite) { - boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite)); + RequestInviteToMUCUIEvent::ImpromptuMode mode = isImpromptu_ ? RequestInviteToMUCUIEvent::Impromptu : RequestInviteToMUCUIEvent::NotImpromptu; + boost::shared_ptr<UIEvent> event(new RequestInviteToMUCUIEvent(muc_->getJID(), jidsToInvite, mode)); eventStream_->send(event); } void MUCController::handleUIEvent(boost::shared_ptr<UIEvent> event) { boost::shared_ptr<InviteToMUCUIEvent> inviteEvent = boost::dynamic_pointer_cast<InviteToMUCUIEvent>(event); if (inviteEvent && inviteEvent->getRoom() == muc_->getJID()) { foreach (const JID& jid, inviteEvent->getInvites()) { muc_->invitePerson(jid, inviteEvent->getReason(), isImpromptu_); } } } void MUCController::handleGetAffiliationsRequest() { muc_->requestAffiliationList(MUCOccupant::Owner); muc_->requestAffiliationList(MUCOccupant::Admin); muc_->requestAffiliationList(MUCOccupant::Member); muc_->requestAffiliationList(MUCOccupant::Outcast); } typedef std::pair<MUCOccupant::Affiliation, JID> AffiliationChangePair; void MUCController::handleChangeAffiliationsRequest(const std::vector<std::pair<MUCOccupant::Affiliation, JID> >& changes) { std::set<JID> addedJIDs; foreach (const AffiliationChangePair& change, changes) { if (change.first != MUCOccupant::NoAffiliation) { addedJIDs.insert(change.second); } } foreach (const AffiliationChangePair& change, changes) { if (change.first != MUCOccupant::NoAffiliation || addedJIDs.find(change.second) == addedJIDs.end()) { muc_->changeAffiliation(change.second, change.first); } } } diff --git a/Swift/Controllers/Chat/UserSearchController.cpp b/Swift/Controllers/Chat/UserSearchController.cpp index 12c6777..f259a9a 100644 --- a/Swift/Controllers/Chat/UserSearchController.cpp +++ b/Swift/Controllers/Chat/UserSearchController.cpp @@ -66,70 +66,71 @@ void UserSearchController::setCanInitiateImpromptuMUC(bool supportsImpromptu) { } window_->setCanStartImpromptuChats(supportsImpromptu); } 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(); switch (type_) { case AddContact: if ((addUserRequest = boost::dynamic_pointer_cast<RequestAddUserDialogUIEvent>(event))) { handle = true; } break; case StartChat: if (boost::dynamic_pointer_cast<RequestChatWithUserDialogUIEvent>(event)) { handle = true; } break; case InviteToChat: if ((inviteToMUCRequest = boost::dynamic_pointer_cast<RequestInviteToMUCUIEvent>(event))) { handle = true; } break; } if (handle) { initializeUserWindow(); window_->show(); if (addUserRequest) { const std::string& name = addUserRequest->getPredefinedName(); const JID& jid = addUserRequest->getPredefinedJID(); if (!name.empty() && jid.isValid()) { window_->prepopulateJIDAndName(jid, name); } } else if (inviteToMUCRequest) { + window_->setCanSupplyDescription(!inviteToMUCRequest->isImpromptu()); window_->setJIDs(inviteToMUCRequest->getInvites()); window_->setRoomJID(inviteToMUCRequest->getRoom()); } return; } } void UserSearchController::handleFormRequested(const JID& service) { window_->setSearchError(false); window_->setServerSupportsSearch(true); //Abort a previous search if is active endDiscoWalker(); delete discoWalker_; discoWalker_ = new DiscoServiceWalker(service, iqRouter_); discoWalker_->onServiceFound.connect(boost::bind(&UserSearchController::handleDiscoServiceFound, this, _1, _2)); discoWalker_->onWalkComplete.connect(boost::bind(&UserSearchController::handleDiscoWalkFinished, this)); discoWalker_->beginWalk(); } void UserSearchController::endDiscoWalker() { if (discoWalker_) { discoWalker_->endWalk(); discoWalker_->onServiceFound.disconnect(boost::bind(&UserSearchController::handleDiscoServiceFound, this, _1, _2)); discoWalker_->onWalkComplete.disconnect(boost::bind(&UserSearchController::handleDiscoWalkFinished, this)); } } void UserSearchController::handleDiscoServiceFound(const JID& jid, boost::shared_ptr<DiscoInfo> info) { //bool isUserDirectory = false; bool supports55 = false; foreach (DiscoInfo::Identity identity, info->getIdentities()) { if ((identity.getCategory() == "directory" && identity.getType() == "user")) { //isUserDirectory = true; diff --git a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h index 69aa0cd..58f45d1 100644 --- a/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/RequestInviteToMUCUIEvent.h @@ -1,35 +1,52 @@ /* * Copyright (c) 2013 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + #pragma once #include <boost/shared_ptr.hpp> #include <vector> #include <Swift/Controllers/UIEvents/UIEvent.h> #include <Swiften/JID/JID.h> namespace Swift { class RequestInviteToMUCUIEvent : public UIEvent { public: typedef boost::shared_ptr<RequestInviteToMUCUIEvent> ref; - RequestInviteToMUCUIEvent(const JID& room, const std::vector<JID>& JIDsToInvite) : room_(room), invite_(JIDsToInvite) { + enum ImpromptuMode { + Impromptu, + NotImpromptu + }; + + RequestInviteToMUCUIEvent(const JID& room, const std::vector<JID>& JIDsToInvite, ImpromptuMode impromptu) : room_(room), invite_(JIDsToInvite) { + isImpromptu_ = impromptu == Impromptu; } const JID& getRoom() const { return room_; } const std::vector<JID> getInvites() const { return invite_; } + bool isImpromptu() const { + return isImpromptu_; + } + private: JID room_; std::vector<JID> invite_; + bool isImpromptu_; }; } diff --git a/Swift/Controllers/UIInterfaces/UserSearchWindow.h b/Swift/Controllers/UIInterfaces/UserSearchWindow.h index 56992cc..9a095aa 100644 --- a/Swift/Controllers/UIInterfaces/UserSearchWindow.h +++ b/Swift/Controllers/UIInterfaces/UserSearchWindow.h @@ -8,46 +8,47 @@ #include <Swiften/Base/boost_bsignals.h> #include <vector> #include <string> #include <Swiften/JID/JID.h> #include <Swift/Controllers/Chat/UserSearchController.h> #include <Swift/Controllers/Contact.h> namespace Swift { class UserSearchWindow { public: enum Type {AddContact, ChatToContact, InviteToChat}; virtual ~UserSearchWindow() {} virtual void clear() = 0; virtual void setResults(const std::vector<UserSearchResult>& results) = 0; virtual void setResultsForm(const Form::ref results) = 0; virtual void addSavedServices(const std::vector<JID>& services) = 0; virtual void setSelectedService(const JID& service) = 0; virtual void setServerSupportsSearch(bool support) = 0; virtual void setSearchError(bool support) = 0; virtual void setSearchFields(boost::shared_ptr<SearchPayload> fields) = 0; virtual void setNameSuggestions(const std::vector<std::string>& suggestions) = 0; virtual void prepopulateJIDAndName(const JID& jid, const std::string& name) = 0; virtual void setContactSuggestions(const std::vector<Contact::ref>& suggestions) = 0; virtual void setJIDs(const std::vector<JID>&) = 0; virtual void setRoomJID(const JID& roomJID) = 0; virtual std::string getReason() const = 0; virtual std::vector<JID> getJIDs() const = 0; virtual void setCanStartImpromptuChats(bool supportsImpromptu) = 0; virtual void updateContacts(const std::vector<Contact::ref>& contacts) = 0; virtual void addContacts(const std::vector<Contact::ref>& contacts) = 0; + virtual void setCanSupplyDescription(bool allowed) = 0; virtual void show() = 0; boost::signal<void (const JID&)> onFormRequested; boost::signal<void (boost::shared_ptr<SearchPayload>, const JID&)> onSearchRequested; boost::signal<void (const JID&)> onNameSuggestionRequested; boost::signal<void (const std::string&)> onContactSuggestionsRequested; boost::signal<void (const std::vector<JID>&)> onJIDUpdateRequested; boost::signal<void (const std::vector<JID>&)> onJIDAddRequested; }; } diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index c154c8f..40b4e28 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -367,70 +367,75 @@ std::vector<JID> QtUserSearchWindow::getJIDs() const { } void QtUserSearchWindow::setCanStartImpromptuChats(bool supportsImpromptu) { supportsImpromptu_ = supportsImpromptu; if (type_ == ChatToContact) { firstMultiJIDPage_->contactList_->setMaximumNoOfContactsToOne(!supportsImpromptu_); } } void QtUserSearchWindow::updateContacts(const std::vector<Contact::ref>& contacts) { if (type_ != AddContact) { firstMultiJIDPage_->contactList_->updateContacts(contacts); } } void QtUserSearchWindow::addContacts(const std::vector<Contact::ref>& contacts) { if (type_ != AddContact) { /* prevent duplicate JIDs from appearing in the contact list */ foreach (Contact::ref newContact, contacts) { bool found = false; foreach (Contact::ref oldContact, contactVector_) { if (newContact->jid == oldContact->jid) { found = true; break; } } if (!found) { contactVector_.push_back(newContact); } } firstMultiJIDPage_->contactList_->setList(contactVector_); firstMultiJIDPage_->emitCompletenessCheck(); } } +void QtUserSearchWindow::setCanSupplyDescription(bool allowed) { + firstMultiJIDPage_->label->setVisible(allowed); + firstMultiJIDPage_->reason_->setVisible(allowed); +} + void QtUserSearchWindow::handleAddViaSearch() { searchNext_ = true; next(); } void QtUserSearchWindow::handleListChanged(std::vector<Contact::ref> list) { contactVector_ = list; if (type_ == ChatToContact) { firstMultiJIDPage_->groupBox->setEnabled(supportsImpromptu_ ? 1 : (contactVector_.size() < 1)); } } void QtUserSearchWindow::handleJIDsAdded(std::vector<JID> jids) { onJIDAddRequested(jids); } void QtUserSearchWindow::setResults(const std::vector<UserSearchResult>& results) { UserSearchModel *newModel = new UserSearchModel(); newModel->setResults(results); resultsPage_->results_->setModel(newModel); resultsPage_->results_->setItemDelegate(delegate_); resultsPage_->results_->setHeaderHidden(true); delete model_; model_ = newModel; resultsPage_->setNoResults(model_->rowCount() == 0); resultsPage_->emitCompletenessCheck(); } void QtUserSearchWindow::setResultsForm(Form::ref results) { QtFormResultItemModel *newModel = new QtFormResultItemModel(this); newModel->setForm(results); resultsPage_->results_->setModel(newModel); resultsPage_->results_->setItemDelegate(new QItemDelegate()); resultsPage_->results_->setHeaderHidden(false); #if QT_VERSION >= 0x050000 diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.h b/Swift/QtUI/UserSearch/QtUserSearchWindow.h index bb89e51..0349ba4 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.h +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.h @@ -19,70 +19,71 @@ namespace Swift { class UIEventStream; class QtUserSearchFirstPage; class QtUserSearchFirstMultiJIDPage; class QtUserSearchFieldsPage; class QtUserSearchResultsPage; class QtUserSearchDetailsPage; class QtFormResultItemModel; class SettingsProvider; class QtUserSearchWindow : public QWizard, public UserSearchWindow, private Ui::QtUserSearchWizard { Q_OBJECT public: QtUserSearchWindow(UIEventStream* eventStream, UserSearchWindow::Type type, const std::set<std::string>& groups, SettingsProvider* settingsProvider); virtual ~QtUserSearchWindow(); virtual void addSavedServices(const std::vector<JID>& services); virtual void clear(); virtual void show(); virtual void setResults(const std::vector<UserSearchResult>& results); virtual void setResultsForm(Form::ref results); virtual void setSelectedService(const JID& jid); virtual void setServerSupportsSearch(bool error); virtual void setSearchError(bool error); virtual void setSearchFields(boost::shared_ptr<SearchPayload> fields); virtual void setNameSuggestions(const std::vector<std::string>& suggestions); virtual void prepopulateJIDAndName(const JID& jid, const std::string& name); virtual void setContactSuggestions(const std::vector<Contact::ref>& suggestions); virtual void setJIDs(const std::vector<JID> &jids); virtual void setRoomJID(const JID &roomJID); virtual std::string getReason() const; virtual std::vector<JID> getJIDs() const; virtual void setCanStartImpromptuChats(bool supportsImpromptu); virtual void updateContacts(const std::vector<Contact::ref> &contacts); virtual void addContacts(const std::vector<Contact::ref>& contacts); + virtual void setCanSupplyDescription(bool allowed); protected: virtual int nextId() const; private slots: void handleFirstPageRadioChange(); virtual void handleCurrentChanged(int); virtual void handleAccepted(); void handleContactSuggestionRequested(const QString& text); void addContact(); void handleAddViaSearch(); void handleListChanged(std::vector<Contact::ref> list); void handleJIDsAdded(std::vector<JID> jids); private: void setFirstPage(QString title = ""); void setSecondPage(); void setThirdPage(); private: void clearForm(); void setError(const QString& error); JID getServerToSearch(); void handleSearch(); JID getContactJID() const; void addSearchedJIDToList(const JID& jid); private: UIEventStream* eventStream_; UserSearchWindow::Type type_; QAbstractItemModel* model_; UserSearchDelegate* delegate_; QtUserSearchFirstPage* firstPage_; QtUserSearchFirstMultiJIDPage* firstMultiJIDPage_; QtUserSearchFieldsPage* fieldsPage_; |
Swift