diff options
-rw-r--r-- | Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h | 2 | ||||
-rw-r--r-- | Swift/QtUI/UserSearch/QtUserSearchWindow.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h b/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h index e420bad..ed9fd85 100644 --- a/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h +++ b/Swift/Controllers/UIEvents/CreateImpromptuMUCUIEvent.h @@ -5,43 +5,43 @@ */ /* * Copyright (c) 2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <string> #include <vector> #include <Swiften/JID/JID.h> #include <Swift/Controllers/UIEvents/UIEvent.h> namespace Swift { class CreateImpromptuMUCUIEvent : public UIEvent { public: /** * @brief CreateImpromptuMUCUIEvent * @param jids A vector of JIDs that are invited to the imprompto MUC. * Useful when the event is used to recreate an old impromptu * chat room. * @param roomJID The full JID of the impromtu MUC. Useful when the event * is used to recreate an old impromptu chat room. * @param reason */ - CreateImpromptuMUCUIEvent(const std::vector<JID>& jids, const JID& roomJID = JID(), const std::string reason = "") : jids_(jids), roomJID_(roomJID), reason_(reason) { } + CreateImpromptuMUCUIEvent(const std::vector<JID>& jids, const JID& roomJID, const std::string reason) : jids_(jids), roomJID_(roomJID), reason_(reason) { } std::vector<JID> getJIDs() const { return jids_; } JID getRoomJID() const { return roomJID_; } std::string getReason() const { return reason_; } private: std::vector<JID> jids_; JID roomJID_; std::string reason_; }; } diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp index e770186..8d15739 100644 --- a/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp +++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.cpp @@ -130,61 +130,61 @@ void QtUserSearchWindow::handleCurrentChanged(int page) { } JID QtUserSearchWindow::getServerToSearch() { if (type_ == Type::AddContact) { return firstPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstPage_->service_->currentText().trimmed())) : myServer_; } else { return firstMultiJIDPage_->byRemoteSearch_->isChecked() ? JID(Q2PSTRING(firstMultiJIDPage_->service_->currentText().trimmed())) : myServer_; } } void QtUserSearchWindow::handleAccepted() { JID jid; std::vector<JID> jids; switch(type_) { case Type::AddContact: jid = getContactJID(); eventStream_->send(std::make_shared<AddContactUIEvent>(jid, detailsPage_->getName(), detailsPage_->getSelectedGroups())); break; case Type::ChatToContact: if (contactVector_.size() == 1) { std::shared_ptr<UIEvent> event(new RequestChatUIEvent(contactVector_[0]->jid)); eventStream_->send(event); break; } for (Contact::ref contact : contactVector_) { jids.push_back(contact->jid); } - eventStream_->send(std::make_shared<CreateImpromptuMUCUIEvent>(jids, Q2PSTRING(firstMultiJIDPage_->reason_->text()))); + eventStream_->send(std::make_shared<CreateImpromptuMUCUIEvent>(jids, JID(), Q2PSTRING(firstMultiJIDPage_->reason_->text()))); break; case Type::InviteToChat: for (Contact::ref contact : contactVector_) { jids.push_back(contact->jid); } eventStream_->send(std::make_shared<InviteToMUCUIEvent>(originatorJID_, jids, Q2PSTRING(firstMultiJIDPage_->reason_->text()))); break; } } void QtUserSearchWindow::handleContactSuggestionRequested(const QString& text) { std::string stdText = Q2PSTRING(text); onContactSuggestionsRequested(stdText); } void QtUserSearchWindow::addContact() { auto contactToAdd = firstMultiJIDPage_->jid_->getContact(); if (!!contactToAdd) { contactVector_.push_back(contactToAdd); firstMultiJIDPage_->jid_->clear(); } firstMultiJIDPage_->contactList_->setList(contactVector_); firstMultiJIDPage_->emitCompletenessCheck(); if (type_ == Type::ChatToContact) { firstMultiJIDPage_->groupBox->setEnabled(supportsImpromptu_ ? 1 : (contactVector_.size() < 1)); } if (!!contactToAdd && contactToAdd->jid.isValid() && contactToAdd->statusType == StatusShow::None) { onJIDUpdateRequested({contactToAdd->jid}); |