From 782ae4c049e2b6fab13d7453cbb0e74610e7d200 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 12 Jan 2018 21:03:09 +0100 Subject: Move Jid class to xmpp-vala, partially refactor namespace --- xmpp-vala/src/module/roster/item.vala | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xmpp-vala/src/module/roster/item.vala') diff --git a/xmpp-vala/src/module/roster/item.vala b/xmpp-vala/src/module/roster/item.vala index 1e39fce2..2fbf03ef 100644 --- a/xmpp-vala/src/module/roster/item.vala +++ b/xmpp-vala/src/module/roster/item.vala @@ -1,7 +1,5 @@ using Gee; -using Xmpp.Core; - namespace Xmpp.Roster { public class Item { @@ -18,9 +16,10 @@ public class Item { public StanzaNode stanza_node; - public string jid { - get { return stanza_node.get_attribute(NODE_JID); } - set { stanza_node.set_attribute(NODE_JID, value); } + private Jid jid_; + public Jid jid { + get { return jid_ ?? (jid_ = Jid.parse(stanza_node.get_attribute(NODE_JID))); } + set { stanza_node.set_attribute(NODE_JID, value.to_string()); } } public string? name { @@ -42,4 +41,4 @@ public class Item { } } -} \ No newline at end of file +} -- cgit v1.2.3-70-g09d2