diff options
author | Samuel Hand <samuel.d.hand@gmail.com> | 2018-08-10 01:40:20 +0100 |
---|---|---|
committer | Samuel Hand <samuel.d.hand@gmail.com> | 2018-08-10 01:40:20 +0100 |
commit | 8ebc2c5dd333ce19c9e0592ee1feb8eed6e1a48f (patch) | |
tree | 4f5a7b77dc51470fa59b67f66e80beb7bb798901 /xmpp-vala/src/module/presence | |
parent | 36cc8b039338442512f0e86d9487d951b5f2c6e3 (diff) | |
download | dino-8ebc2c5dd333ce19c9e0592ee1feb8eed6e1a48f.tar.gz dino-8ebc2c5dd333ce19c9e0592ee1feb8eed6e1a48f.zip |
Fix mutual subscription detection
Diffstat (limited to 'xmpp-vala/src/module/presence')
-rw-r--r-- | xmpp-vala/src/module/presence/module.vala | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/xmpp-vala/src/module/presence/module.vala b/xmpp-vala/src/module/presence/module.vala index 2188d89d..4a9a72a3 100644 --- a/xmpp-vala/src/module/presence/module.vala +++ b/xmpp-vala/src/module/presence/module.vala @@ -15,13 +15,9 @@ namespace Xmpp.Presence { public signal void received_subscription_request(XmppStream stream, Jid jid); public signal void received_subscription_approval(XmppStream stream, Jid jid); public signal void received_unsubscription(XmppStream stream, Jid jid); - public signal void mutual_subscription(XmppStream stream, Jid jid); public bool available_resource = true; - private Gee.List<Jid> subscriptions = new ArrayList<Jid>(Jid.equals_bare_func); - private Gee.List<Jid> subscribers = new ArrayList<Jid>(Jid.equals_bare_func); - public void request_subscription(XmppStream stream, Jid bare_jid) { Presence.Stanza presence = new Presence.Stanza(); presence.to = bare_jid; @@ -34,8 +30,6 @@ namespace Xmpp.Presence { presence.to = bare_jid; presence.type_ = Presence.Stanza.TYPE_SUBSCRIBED; send_presence(stream, presence); - subscribers.add(bare_jid); - if (subscriptions.contains(bare_jid)) mutual_subscription(stream, bare_jid); } public void deny_subscription(XmppStream stream, Jid bare_jid) { @@ -47,7 +41,6 @@ namespace Xmpp.Presence { presence.to = bare_jid; presence.type_ = Presence.Stanza.TYPE_UNSUBSCRIBED; send_presence(stream, presence); - subscribers.remove(bare_jid); } public void unsubscribe(XmppStream stream, Jid bare_jid) { @@ -55,7 +48,6 @@ namespace Xmpp.Presence { presence.to = bare_jid; presence.type_ = Presence.Stanza.TYPE_UNSUBSCRIBE; send_presence(stream, presence); - subscriptions.remove(bare_jid); } public void send_presence(XmppStream stream, Presence.Stanza presence) { @@ -92,16 +84,12 @@ namespace Xmpp.Presence { break; case Presence.Stanza.TYPE_SUBSCRIBED: received_subscription_approval(stream, presence.from); - subscriptions.add(presence.from); - if (subscribers.contains(presence.from)) mutual_subscription(stream, presence.from); break; case Presence.Stanza.TYPE_UNSUBSCRIBE: stream.get_flag(Flag.IDENTITY).remove_presence(presence.from); received_unsubscription(stream, presence.from); - subscribers.remove(presence.from); break; case Presence.Stanza.TYPE_UNSUBSCRIBED: - subscriptions.remove(presence.from); break; } } |