Skip to content

Commit

Permalink
Default domain_blocked to false in blocking_manager.vala
Browse files Browse the repository at this point in the history
  • Loading branch information
eerielili committed Jun 21, 2024
1 parent d9f5b70 commit 51fe91d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libdino/src/service/blocking_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ public class BlockingManager : StreamInteractionModule, Object {
this.stream_interactor = stream_interactor;
}

public bool is_blocked(Account account, Jid jid, bool domainblock) {
public bool is_blocked(Account account, Jid jid, bool domainblock = false) {
XmppStream stream = stream_interactor.get_stream(account);
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, bool domainblock) {
public void block(Account account, Jid jid, bool domainblock = false) {
XmppStream stream = stream_interactor.get_stream(account);
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, bool domainblock) {
public void unblock(Account account, Jid jid, bool domainblock = false) {
XmppStream stream = stream_interactor.get_stream(account);
string jid_str = domainblock ? jid.domainpart.to_string () : jid.to_string();
stream.get_module(Xmpp.Xep.BlockingCommand.Module.IDENTITY).unblock(stream, { jid_str });
Expand Down
4 changes: 2 additions & 2 deletions main/src/ui/conversation_details.vala
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ namespace Dino.Ui.ConversationDetails {
});
view_model.block_changed.connect(() => {
if (view_model.blocked) {
stream_interactor.get_module(BlockingManager.IDENTITY).unblock(model.conversation.account, model.conversation.counterpart, false);
stream_interactor.get_module(BlockingManager.IDENTITY).unblock(model.conversation.account, model.conversation.counterpart);
} else {
stream_interactor.get_module(BlockingManager.IDENTITY).block(model.conversation.account, model.conversation.counterpart, false);
stream_interactor.get_module(BlockingManager.IDENTITY).block(model.conversation.account, model.conversation.counterpart);
}
view_model.blocked = !view_model.blocked;
});
Expand Down

0 comments on commit 51fe91d

Please sign in to comment.