From f24b47c44db03a8d9ba611f827e71aeb1f63d0bd Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 12 Mar 2017 14:44:09 +0100 Subject: PGP module: store data in own db, use pgp key as specified in account settings --- plugins/openpgp/src/stream_flag.vala | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 plugins/openpgp/src/stream_flag.vala (limited to 'plugins/openpgp/src/stream_flag.vala') diff --git a/plugins/openpgp/src/stream_flag.vala b/plugins/openpgp/src/stream_flag.vala new file mode 100644 index 00000000..5ace26bd --- /dev/null +++ b/plugins/openpgp/src/stream_flag.vala @@ -0,0 +1,25 @@ +using Gee; + +using Xmpp; +using Xmpp.Core; + +namespace Dino.Plugins.OpenPgp { + +public class Flag : XmppStreamFlag { + public const string ID = "pgp"; + public HashMap key_ids = new HashMap(); + + public string? get_key_id(string jid) { return key_ids[get_bare_jid(jid)]; } + + public void set_key_id(string jid, string key) { key_ids[get_bare_jid(jid)] = key; } + + public static Flag? get_flag(XmppStream stream) { return (Flag?) stream.get_flag(NS_URI, ID); } + + public static bool has_flag(XmppStream stream) { return get_flag(stream) != null; } + + public override string get_ns() { return NS_URI; } + + public override string get_id() { return ID; } +} + +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf