diff options
author | fiaxh <git@mx.ax.lt> | 2017-03-10 17:01:45 +0100 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-03-10 17:11:25 +0100 |
commit | 2fe8489d368a371aefbfbe66e74621a8df14cdc2 (patch) | |
tree | 4dec90236b28101383753ffe4a1c7a34b09b0208 /xmpp-vala/src/module/roster/item.vala | |
parent | 7a1aa8c806a63cfd031c082524501e26d4a181ee (diff) | |
download | dino-2fe8489d368a371aefbfbe66e74621a8df14cdc2.tar.gz dino-2fe8489d368a371aefbfbe66e74621a8df14cdc2.zip |
Rename vala-xmpp library to xmpp-vala
Diffstat (limited to 'xmpp-vala/src/module/roster/item.vala')
-rw-r--r-- | xmpp-vala/src/module/roster/item.vala | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/xmpp-vala/src/module/roster/item.vala b/xmpp-vala/src/module/roster/item.vala new file mode 100644 index 00000000..7ef76fd4 --- /dev/null +++ b/xmpp-vala/src/module/roster/item.vala @@ -0,0 +1,45 @@ +using Gee; + +using Xmpp.Core; + +namespace Xmpp.Roster { + +public class Item { + + public const string NODE_JID = "jid"; + public const string NODE_NAME = "name"; + public const string NODE_SUBSCRIPTION = "subscription"; + + public const string SUBSCRIPTION_NONE = "none"; + public const string SUBSCRIPTION_TO = "to"; + public const string SUBSCRIPTION_FROM = "from"; + public const string SUBSCRIPTION_BOTH = "both"; + public const string SUBSCRIPTION_REMOVE = "remove"; + + public StanzaNode stanza_node; + + public string jid { + get { return stanza_node.get_attribute(NODE_JID); } + set { stanza_node.set_attribute(NODE_JID, value); } + } + + public string? name { + get { return stanza_node.get_attribute(NODE_NAME); } + set { stanza_node.set_attribute(NODE_NAME, value); } + } + + public string? subscription { + get { return stanza_node.get_attribute(NODE_SUBSCRIPTION); } + set { stanza_node.set_attribute(NODE_SUBSCRIPTION, value); } + } + + public Item() { + stanza_node = new StanzaNode.build("item", NS_URI); + } + + public Item.from_stanza_node(StanzaNode stanza_node) { + this.stanza_node = stanza_node; + } +} + +}
\ No newline at end of file |