diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-02 15:37:32 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-02 15:37:32 +0100 |
commit | 56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d (patch) | |
tree | 0bd0c2c80cb81179c26282fb3fbe8fd22983f40b /vala-xmpp/src/module/roster/flag.vala | |
download | dino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.tar.gz dino-56bc45ce4d07a7a9a415e9dc8ad2f7c3f3c9e48d.zip |
Initial commit
Diffstat (limited to 'vala-xmpp/src/module/roster/flag.vala')
-rw-r--r-- | vala-xmpp/src/module/roster/flag.vala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vala-xmpp/src/module/roster/flag.vala b/vala-xmpp/src/module/roster/flag.vala new file mode 100644 index 00000000..c3e35158 --- /dev/null +++ b/vala-xmpp/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 |