diff options
author | fiaxh <git@lightrise.org> | 2023-09-24 19:54:04 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-09-24 19:54:04 +0200 |
commit | e2c34bf2235c9f85fc91de9c0f1b74858f4ef89e (patch) | |
tree | f5565f57a7cbea8a13748e8a1c613540bbb4d76c /main/src/ui/contact_details/blocking_provider.vala | |
parent | 9eafe4139d6b2c0cabe3c77a903d6ae931a26975 (diff) | |
download | dino-e2c34bf2235c9f85fc91de9c0f1b74858f4ef89e.tar.gz dino-e2c34bf2235c9f85fc91de9c0f1b74858f4ef89e.zip |
Rewrite contact details dialog
Diffstat (limited to 'main/src/ui/contact_details/blocking_provider.vala')
-rw-r--r-- | main/src/ui/contact_details/blocking_provider.vala | 36 |
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); - } - } -} - -} |