aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity/encryption.vala
blob: f6427b02a9568672fa33f6df7154cd5f0ec1326f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace Dino.Entities {

public enum Encryption {
        NONE,
        PGP,
        OMEMO,
        DTLS_SRTP,
        SRTP,
        UNKNOWN;

        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;
        }
}

}