diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 23:06:12 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-03 23:06:12 +0100 |
| commit | d9b0969ef93a927a7bf838ab7fd2a6036441c26f (patch) | |
| tree | 9c62dccc8584d4bf0496ca8f4d823210219a8590 | |
| parent | 5f43d03b050ce303853f22cee6e1a23f9e1b1ffc (diff) | |
| -rw-r--r-- | xxcc.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -228,18 +228,12 @@ void xxcc::send(void) const auto from = selected->jidBare(), to = ui.jid->text(), msg = ui.chatinput->toPlainText(); - const bool enc = ui.omemo->isChecked(); QXmppMessage out(from, to, msg); const auto dt = QDateTime::currentDateTimeUtc(); - out.setE2eeFallbackBody("[xxcc: This is an OMEMO-encrypted message]"); out.setStamp(dt); - // TODO: QXmpp forces OMEMO 2 (XEP-0384 version >= 0.8.0). - // This breaks compatibility with Dino and Gajim, who still use 0.1.0. - // out.setEncryptionMethod(QXmpp::Omemo0); - selected->sendSensitive(std::move(out)).then(this, - [=](const QXmpp::SendResult &&result) mutable + auto fn = [=](const QXmpp::SendResult &&result) mutable { qDebug() << "result.index(): " << result.index(); @@ -256,7 +250,19 @@ void xxcc::send(void) const auto &error = std::get<QXmppError>(result); qDebug() << error.description; } - }); + }; + + if (ui.omemo->isChecked()) + { + out.setE2eeFallbackBody("[xxcc: This is an OMEMO-encrypted message]"); + // TODO: QXmpp forces OMEMO 2 (XEP-0384 version >= 0.8.0). + // This breaks compatibility with Dino and Gajim, who still use 0.1.0. + // out.setEncryptionMethod(QXmpp::Omemo0); + + selected->sendSensitive(std::move(out)).then(this, fn); + } + else + selected->send(std::move(out)).then(this, fn); } void xxcc::storeMessage(const QString &from, const QString &to, |
