aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/contact_details/blocking_provider.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/contact_details/blocking_provider.vala')
-rw-r--r--main/src/ui/contact_details/blocking_provider.vala36
1 files changed, 0 insertions, 36 deletions
diff --git a/main/src/ui/contact_details/blocking_provider.vala b/main/src/ui/contact_details/blocking_provider.vala
deleted file mode 100644
index 7e4a475d..00000000
--- a/main/src/ui/contact_details/blocking_provider.vala
+++ /dev/null
@@ -1,36 +0,0 @@
-using Gtk;
-
-using Dino.Entities;
-
-namespace Dino.Ui.ContactDetails {
-
-public class BlockingProvider : Plugins.ContactDetailsProvider, Object {
- public string id { get { return "blocking"; } }
-
- private StreamInteractor stream_interactor;
-
- public BlockingProvider(StreamInteractor stream_interactor) {
- this.stream_interactor = stream_interactor;
- }
-
- public void populate(Conversation conversation, Plugins.ContactDetails contact_details, Plugins.WidgetType type) {
- if (type != Plugins.WidgetType.GTK4) return;
- if (conversation.type_ != Conversation.Type.CHAT) return;
-
- if (stream_interactor.get_module(BlockingManager.IDENTITY).is_supported(conversation.account)) {
- bool is_blocked = stream_interactor.get_module(BlockingManager.IDENTITY).is_blocked(conversation.account, conversation.counterpart);
- Switch sw = new Switch() { active=is_blocked, valign=Align.CENTER };
- sw.state_set.connect((state) => {
- if (state) {
- stream_interactor.get_module(BlockingManager.IDENTITY).block(conversation.account, conversation.counterpart);
- } else {
- stream_interactor.get_module(BlockingManager.IDENTITY).unblock(conversation.account, conversation.counterpart);
- }
- return false;
- });
- contact_details.add(_("Settings"), _("Block"), _("Communication and status updates in either direction are blocked"), sw);
- }
- }
-}
-
-}