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:
parent
6c9e41c1b2
commit
813690c10a
1 changed files with 5 additions and 4 deletions
|
@ -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.
|
||||
message.addExtension(new ExplicitMessageEncryptionElement(
|
||||
ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol.openpgpV0));
|
||||
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.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue