diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-04-01 02:43:41 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-04-01 02:44:36 +0200 |
| commit | d166666acb2653c4522266be749fb3b2f3dd05eb (patch) | |
| tree | 8dfe1c150cfb1c74c84fcb1d0377430057f4973b /libdino/src/entity/encryption.vala | |
| parent | b75b6062abc07b25d0dcd6717e168aa85be7cf4e (diff) | |
| download | dino-d166666acb2653c4522266be749fb3b2f3dd05eb.tar.gz | |
Setup default encryption settings
Diffstat (limited to 'libdino/src/entity/encryption.vala')
| -rw-r--r-- | libdino/src/entity/encryption.vala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libdino/src/entity/encryption.vala b/libdino/src/entity/encryption.vala index ab5a0ae0..6868def4 100644 --- a/libdino/src/entity/encryption.vala +++ b/libdino/src/entity/encryption.vala @@ -11,6 +11,27 @@ namespace Dino.Entities { public bool is_some() { return this != NONE; } + + public static Encryption parse(string str) { + switch (str) { + case "DINO_ENTITIES_ENCRYPTION_NONE": + return NONE; + case "DINO_ENTITIES_ENCRYPTION_PGP": + return PGP; + case "DINO_ENTITIES_ENCRYPTION_OMEMO": + return OMEMO; + case "DINO_ENTITIES_ENCRYPTION_DTLS_SRTP": + return DTLS_SRTP; + case "DINO_ENTITIES_ENCRYPTION_SRTP": + return SRTP; + case "DINO_ENTITIES_ENCRYPTION_UNKNOWN": + // Fall through. + default: + break; + } + + return UNKNOWN; + } } }
\ No newline at end of file |
