1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 20:42:06 +01:00

Check if message has EME before adding it

This commit is contained in:
Paul Schaub 2018-07-03 11:40:02 +02:00
parent 6c9e41c1b2
commit 813690c10a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -102,10 +102,11 @@ public class OpenPgpContact implements FingerprintsChangedListener {
message.addExtension(encryptedPayload);
// Add additional information to the message
// STOPSHIP: 20.06.18 BELOW
// TODO: Check if message already contains EME element.
if (!ExplicitMessageEncryptionElement.hasProtocol(message,
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.openpgpV0)) {
message.addExtension(new ExplicitMessageEncryptionElement(
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.openpgpV0));
}
StoreHint.set(message);
message.setBody("This message is encrypted using XEP-0374: OpenPGP for XMPP: Instant Messaging.");