diff options
Diffstat (limited to 'libdino')
-rw-r--r-- | libdino/src/service/blocking_manager.vala | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libdino/src/service/blocking_manager.vala b/libdino/src/service/blocking_manager.vala index aa07f990..1c125aac 100644 --- a/libdino/src/service/blocking_manager.vala +++ b/libdino/src/service/blocking_manager.vala @@ -20,19 +20,22 @@ public class BlockingManager : StreamInteractionModule, Object { this.stream_interactor = stream_interactor; } - public bool is_blocked(Account account, Jid jid) { + public bool is_blocked(Account account, Jid jid, bool domainblock = false) { XmppStream stream = stream_interactor.get_stream(account); - return stream != null && stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).is_blocked(stream, jid.to_string()); + string jid_str = domainblock ? jid.domainpart.to_string () : jid.to_string(); + return stream != null && stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).is_blocked(stream, jid_str); } - public void block(Account account, Jid jid) { + public void block(Account account, Jid jid, bool domainblock = false) { XmppStream stream = stream_interactor.get_stream(account); - stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).block(stream, { jid.to_string() }); + string jid_str = domainblock ? jid.domainpart.to_string () : jid.to_string(); + stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).block(stream, { jid_str }); } - public void unblock(Account account, Jid jid) { + public void unblock(Account account, Jid jid, bool domainblock = false) { XmppStream stream = stream_interactor.get_stream(account); - stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).unblock(stream, { jid.to_string() }); + string jid_str = domainblock ? jid.domainpart.to_string () : jid.to_string(); + stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).unblock(stream, { jid_str }); } public bool is_supported(Account account) { |