diff options
author | fiaxh <git@lightrise.org> | 2023-01-11 19:54:02 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-01-11 19:54:02 +0100 |
commit | 75500dc767f2cf657c0fbb5d2a4d4557183ed2e9 (patch) | |
tree | 87f67a933f0459f966932531b427944bb9f67a1f /main/src/ui/contact_details | |
parent | cb3b19b01deb8460627578b885339e7528411f6f (diff) | |
download | dino-75500dc767f2cf657c0fbb5d2a4d4557183ed2e9.tar.gz dino-75500dc767f2cf657c0fbb5d2a4d4557183ed2e9.zip |
Support pinning of conversations (locally)
fixes #290
fixes #1330
Diffstat (limited to 'main/src/ui/contact_details')
-rw-r--r-- | main/src/ui/contact_details/settings_provider.vala | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |