aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src/encryption_list_entry.vala
blob: 96607e1e55212a8d71577b40195a028df92286be (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
using Dino.Entities;

namespace Dino.Plugins.OpenPgp {

private class EncryptionListEntry : Plugins.EncryptionListEntry, Object {

    private StreamInteractor stream_interactor;

    public EncryptionListEntry(StreamInteractor stream_interactor) {
        this.stream_interactor = stream_interactor;
    }

    public Entities.Encryption encryption { get {
        return Encryption.PGP;
    }}

    public string name { get {
        return "OpenPGP";
    }}

    public bool can_encrypt(Entities.Conversation conversation) {
        return Manager.get_instance(stream_interactor).get_key_id(conversation.account, conversation.counterpart) != null;
    }
}

}