diff options
| author | Melvin Keskin <melvo@olomono.de> | 2023-03-07 23:22:06 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2023-03-13 20:28:49 +0100 |
| commit | bb9f20419c794e4555860e6aeb097229653d5dc9 (patch) | |
| tree | 3605d2ad65a26dbecbb12b8d754316611e72fd84 | |
| parent | 867f74bd0c48eeca47dfa49999db8502d054b15c (diff) | |
EME: Always send encryption name as fallback
Since QXmpp does not differentiate between different EME versions
receiving clients support, it is better to always send the encryption name.
It ensures that a name is displayed by the receiving client even if it
does not support the latest EME version introducing a new encryption.
| -rw-r--r-- | src/base/QXmppMessage.cpp | 2 | ||||
| -rw-r--r-- | tests/qxmppmessage/tst_qxmppmessage.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/base/QXmppMessage.cpp b/src/base/QXmppMessage.cpp index c0923d22..9527f5ed 100644 --- a/src/base/QXmppMessage.cpp +++ b/src/base/QXmppMessage.cpp @@ -1659,7 +1659,7 @@ void QXmppMessage::serializeExtensions(QXmlStreamWriter *writer, QXmpp::SceMode writer->writeStartElement(QStringLiteral("encryption")); writer->writeDefaultNamespace(ns_eme); writer->writeAttribute(QStringLiteral("namespace"), d->encryptionMethod); - helperToXmlAddAttribute(writer, QStringLiteral("name"), d->encryptionName); + helperToXmlAddAttribute(writer, QStringLiteral("name"), encryptionName()); writer->writeEndElement(); } diff --git a/tests/qxmppmessage/tst_qxmppmessage.cpp b/tests/qxmppmessage/tst_qxmppmessage.cpp index deca437e..98ca5670 100644 --- a/tests/qxmppmessage/tst_qxmppmessage.cpp +++ b/tests/qxmppmessage/tst_qxmppmessage.cpp @@ -783,7 +783,7 @@ void tst_QXmppMessage::testEme() // test standard encryption: OMEMO const QByteArray xmlOmemo( "<message to=\"foo@example.com/QXmpp\" from=\"bar@example.com/QXmpp\" type=\"normal\">" - "<encryption xmlns=\"urn:xmpp:eme:0\" namespace=\"eu.siacs.conversations.axolotl\"/>" + "<encryption xmlns=\"urn:xmpp:eme:0\" namespace=\"eu.siacs.conversations.axolotl\" name=\"OMEMO\"/>" "<body>This message is encrypted with OMEMO, but your client doesn't seem to support that.</body>" "</message>"); |
