aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/roster/flag.vala
blob: c3e3515806775d4fb73994f352dc7d65f6fea3ec (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
27
28
29
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; }
}

}