aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/roster/flag.vala
diff options
context:
space:
mode:
authorfiaxh <git@mx.ax.lt>2017-03-10 17:01:45 +0100
committerfiaxh <git@mx.ax.lt>2017-03-10 17:11:25 +0100
commit2fe8489d368a371aefbfbe66e74621a8df14cdc2 (patch)
tree4dec90236b28101383753ffe4a1c7a34b09b0208 /xmpp-vala/src/module/roster/flag.vala
parent7a1aa8c806a63cfd031c082524501e26d4a181ee (diff)
downloaddino-2fe8489d368a371aefbfbe66e74621a8df14cdc2.tar.gz
dino-2fe8489d368a371aefbfbe66e74621a8df14cdc2.zip
Rename vala-xmpp library to xmpp-vala
Diffstat (limited to 'xmpp-vala/src/module/roster/flag.vala')
-rw-r--r--xmpp-vala/src/module/roster/flag.vala30
1 files changed, 30 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/roster/flag.vala b/xmpp-vala/src/module/roster/flag.vala
new file mode 100644
index 00000000..c3e35158
--- /dev/null
+++ b/xmpp-vala/src/module/roster/flag.vala
@@ -0,0 +1,30 @@
+using Gee;
+
+using Xmpp.Core;
+
+namespace Xmpp.Roster {
+
+public class Flag : XmppStreamFlag {
+ public const string ID = "roster";
+ public HashMap<string, Item> roster_items = new HashMap<string, Item>();
+
+ internal string? iq_id;
+
+ public Collection<Item> get_roster() {
+ return roster_items.values;
+ }
+
+ public Item? get_item(string jid) {
+ return roster_items[jid];
+ }
+
+ 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