aboutsummaryrefslogtreecommitdiff
path: root/vala-xmpp/src/module/xep/0027_pgp/flag.vala
diff options
context:
space:
mode:
Diffstat (limited to 'vala-xmpp/src/module/xep/0027_pgp/flag.vala')
-rw-r--r--vala-xmpp/src/module/xep/0027_pgp/flag.vala24
1 files changed, 24 insertions, 0 deletions
diff --git a/vala-xmpp/src/module/xep/0027_pgp/flag.vala b/vala-xmpp/src/module/xep/0027_pgp/flag.vala
new file mode 100644
index 00000000..03844afa
--- /dev/null
+++ b/vala-xmpp/src/module/xep/0027_pgp/flag.vala
@@ -0,0 +1,24 @@
+using Gee;
+
+using Xmpp.Core;
+
+namespace Xmpp.Xep.Pgp {
+
+public class Flag : XmppStreamFlag {
+ public const string ID = "pgp";
+ public HashMap<string, string> key_ids = new HashMap<string, string>();
+
+ 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