From 75500dc767f2cf657c0fbb5d2a4d4557183ed2e9 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 11 Jan 2023 19:54:02 +0100 Subject: Support pinning of conversations (locally) fixes #290 fixes #1330 --- main/src/ui/contact_details/settings_provider.vala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main/src/ui/contact_details') diff --git a/main/src/ui/contact_details/settings_provider.vala b/main/src/ui/contact_details/settings_provider.vala index 140ebcab..6c43dbfd 100644 --- a/main/src/ui/contact_details/settings_provider.vala +++ b/main/src/ui/contact_details/settings_provider.vala @@ -49,6 +49,12 @@ public class SettingsProvider : Plugins.ContactDetailsProvider, Object { combobox.active_id = get_notify_setting_id(conversation.notify_setting); combobox.changed.connect(() => { conversation.notify_setting = get_notify_setting(combobox.active_id); } ); } + + Switch pinned_switch = new Switch(); + string category = conversation.type_ == Conversation.Type.GROUPCHAT ? DETAILS_HEADLINE_ROOM : DETAILS_HEADLINE_CHAT; + contact_details.add(category, _("Pin conversation"), _("Pins the conversation to the top of the conversation list"), pinned_switch); + pinned_switch.state = conversation.pinned != 0; + pinned_switch.state_set.connect((state) => { conversation.pinned = state ? 1 : 0; return false; }); } private Conversation.Setting get_setting(string id) { -- cgit v1.2.3-70-g09d2