diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-02-14 09:26:13 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-02-14 09:26:13 (GMT) |
commit | aae3defeecd5a000db33c973f9241d8b9db12c0c (patch) | |
tree | eda2a5a2d45f5a70c2f5d64272ecf2a73f008a15 /Swift/QtUI | |
parent | 67087f4374ddca69c4d3d9303e85795f060f50a2 (diff) | |
download | swift-contrib-aae3defeecd5a000db33c973f9241d8b9db12c0c.zip swift-contrib-aae3defeecd5a000db33c973f9241d8b9db12c0c.tar.bz2 |
Fix rendering of mediated invites
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtChatWindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index ed8e632..4cf606c 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -773,54 +773,57 @@ void QtChatWindow::handleActionButtonClicked() { QString jid = QInputDialog::getText(this, tr("Enter person's address"), tr("Address:"), QLineEdit::Normal, "", &ok); if (ok) { onInvitePersonToThisMUCRequest(JID(Q2PSTRING(jid)), ""); } } } void QtChatWindow::handleAffiliationEditorAccepted() { onChangeAffiliationsRequest(affiliationEditor_->getChanges()); } void QtChatWindow::setAffiliations(MUCOccupant::Affiliation affiliation, const std::vector<JID>& jids) { if (!affiliationEditor_) return; affiliationEditor_->setAffiliations(affiliation, jids); } void QtChatWindow::showRoomConfigurationForm(Form::ref form) { if (mucConfigurationWindow_) { delete mucConfigurationWindow_.data(); } mucConfigurationWindow_ = new QtMUCConfigurationWindow(form); mucConfigurationWindow_->onFormComplete.connect(boost::bind(boost::ref(onConfigureRequest), _1)); mucConfigurationWindow_->onFormCancelled.connect(boost::bind(boost::ref(onConfigurationFormCancelled))); } void QtChatWindow::addMUCInvitation(const JID& jid, const std::string& reason, const std::string& /*password*/, bool direct) { bool accepted = false; QMessageBox msgBox; //FIXME: horrid modal untranslated popup. Fix before release. msgBox.setText(QString("You have been invited to the room %1 by %2.").arg(P2QSTRING(jid.toString())).arg(contact_)); QString reasonString; if (!reason.empty()) { reasonString = QString("\"%1\"").arg(P2QSTRING(reason)); } if (!direct) { - reasonString += QString("(%1 may not have really sent this invitation)").arg(P2QSTRING(jid.toString())); + if (!reasonString.isEmpty()) { + reasonString += " "; + } + reasonString += QString(" (%1 may not have really sent this invitation)").arg(contact_); } msgBox.setInformativeText(QString("Accept invitation from %1 to enter %2?\n%3").arg(contact_).arg(P2QSTRING(jid.toString())).arg(reasonString)); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::Yes); int ret = msgBox.exec(); switch (ret) { case QMessageBox::Yes: accepted = true; break; default: break; } if (accepted) { eventStream_->send(boost::make_shared<JoinMUCUIEvent>(jid)); } } } |