diff options
author | fiaxh <git@lightrise.org> | 2024-12-28 20:29:52 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2025-01-12 19:35:58 +0100 |
commit | 6322ed819e47d9c3371f214e4209d01cac1abfcf (patch) | |
tree | a7cfeed708a59f5eb99b4dbed70b0efb9212446f /xmpp-vala/src | |
parent | 5ee322cbd987d36497522b82b876659e1d19da43 (diff) | |
download | dino-6322ed819e47d9c3371f214e4209d01cac1abfcf.tar.gz dino-6322ed819e47d9c3371f214e4209d01cac1abfcf.zip |
Show banner when contact is not yet subscribed
Diffstat (limited to 'xmpp-vala/src')
-rw-r--r-- | xmpp-vala/src/module/roster/item.vala | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/xmpp-vala/src/module/roster/item.vala b/xmpp-vala/src/module/roster/item.vala index 78974a35..4c9f30ef 100644 --- a/xmpp-vala/src/module/roster/item.vala +++ b/xmpp-vala/src/module/roster/item.vala @@ -4,12 +4,10 @@ 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"; + /** the user has a subscription to the contact's presence, but the contact does not have a subscription to the user's presence */ public const string SUBSCRIPTION_TO = "to"; + /** the contact has a subscription to the user's presence, but the user does not have a subscription to the contact's presence */ public const string SUBSCRIPTION_FROM = "from"; public const string SUBSCRIPTION_BOTH = "both"; public const string SUBSCRIPTION_REMOVE = "remove"; @@ -20,23 +18,31 @@ public class Item { public Jid? jid { get { try { - return jid_ ?? (jid_ = new Jid(stanza_node.get_attribute(NODE_JID))); + return jid_ ?? (jid_ = new Jid(stanza_node.get_attribute("jid"))); } catch (InvalidJidError e) { warning("Ignoring invalid Jid in roster entry: %s", e.message); return null; } } - set { stanza_node.set_attribute(NODE_JID, value.to_string()); } + set { stanza_node.set_attribute("jid", value.to_string()); } } public string? name { - get { return stanza_node.get_attribute(NODE_NAME); } - set { if (value != null) stanza_node.set_attribute(NODE_NAME, value); } + get { return stanza_node.get_attribute("name"); } + set { if (value != null) stanza_node.set_attribute("name", value); } } public string? subscription { - get { return stanza_node.get_attribute(NODE_SUBSCRIPTION); } - set { if (value != null) stanza_node.set_attribute(NODE_SUBSCRIPTION, value); } + get { return stanza_node.get_attribute("subscription"); } + set { if (value != null) stanza_node.set_attribute("subscription", value); } + } + + public string? ask { + get { return stanza_node.get_attribute("ask"); } + } + + public bool subscription_requested { + get { return this.ask != null; } } public Item() { |