From 8ebc2c5dd333ce19c9e0592ee1feb8eed6e1a48f Mon Sep 17 00:00:00 2001 From: Samuel Hand Date: Fri, 10 Aug 2018 01:40:20 +0100 Subject: Fix mutual subscription detection --- libdino/src/service/presence_manager.vala | 4 ---- libdino/src/service/roster_manager.vala | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'libdino/src/service') diff --git a/libdino/src/service/presence_manager.vala b/libdino/src/service/presence_manager.vala index 62100c2c..e832687d 100644 --- a/libdino/src/service/presence_manager.vala +++ b/libdino/src/service/presence_manager.vala @@ -11,7 +11,6 @@ public class PresenceManager : StreamInteractionModule, Object { public signal void show_received(Show show, Jid jid, Account account); public signal void received_subscription_request(Jid jid, Account account); public signal void received_subscription_approval(Jid jid, Account account); - public signal void mutual_subscription(Jid jid, Account account); private StreamInteractor stream_interactor; private HashMap>> shows = new HashMap>>(Jid.hash_bare_func, Jid.equals_bare_func); @@ -99,9 +98,6 @@ public class PresenceManager : StreamInteractionModule, Object { stream_interactor.module_manager.get_module(account, Presence.Module.IDENTITY).received_subscription_approval.connect((stream, jid) => { received_subscription_approval(jid, account); }); - stream_interactor.module_manager.get_module(account, Presence.Module.IDENTITY).mutual_subscription.connect((stream, jid) => { - mutual_subscription(jid, account); - }); } private void on_received_available_show(Account account, Jid jid, string show) { diff --git a/libdino/src/service/roster_manager.vala b/libdino/src/service/roster_manager.vala index 23bc8b76..5181b90e 100644 --- a/libdino/src/service/roster_manager.vala +++ b/libdino/src/service/roster_manager.vala @@ -11,6 +11,7 @@ public class RosterManager : StreamInteractionModule, Object { public signal void removed_roster_item(Account account, Jid jid, Roster.Item roster_item); public signal void updated_roster_item(Account account, Jid jid, Roster.Item roster_item); + public signal void mutual_subscription(Account account, Jid jid); private StreamInteractor stream_interactor; private Database db; @@ -66,6 +67,10 @@ public class RosterManager : StreamInteractionModule, Object { stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).item_updated.connect_after( (stream, roster_item) => { on_roster_item_updated(account, roster_item); }); + + stream_interactor.module_manager.get_module(account, Roster.Module.IDENTITY).mutual_subscription.connect_after( (stream, jid) => { + mutual_subscription(account, jid); + }); } private void on_roster_item_updated(Account account, Roster.Item roster_item) { -- cgit v1.2.3-70-g09d2