diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-10-28 22:40:09 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-10-28 22:40:09 +0100 |
commit | a7fd629c051a3ba0031fba4e358ba4f3b843283d (patch) | |
tree | f0db50f70b0504c72b92dc44eab38346124940d4 /src/main/java/eu/siacs/conversations/utils | |
parent | ec473a4437b3bff88e80404b7012ae15d3c09c3d (diff) |
show encryption type in warned/red messages
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/CryptoHelper.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java index 8091a996..ab407249 100644 --- a/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/CryptoHelper.java @@ -23,6 +23,8 @@ import java.util.LinkedHashSet; import java.util.List; import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; +import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; @@ -164,4 +166,17 @@ public final class CryptoHelper { return null; } } + + public static int encryptionTypeToText(int encryption) { + switch (encryption) { + case Message.ENCRYPTION_OTR: + return R.string.encryption_choice_otr; + case Message.ENCRYPTION_AXOLOTL: + return R.string.encryption_choice_omemo; + case Message.ENCRYPTION_NONE: + return R.string.encryption_choice_unencrypted; + default: + return R.string.encryption_choice_pgp; + } + } } |