From a8ba4a397419b3b6d3d167b21a8da72dcdbe1961 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 24 Aug 2017 17:24:22 +0200 Subject: "Default" per-contact settings (change UI) --- libdino/src/entity/conversation.vala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libdino/src') diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala index d0a3e9d7..a978cf10 100644 --- a/libdino/src/entity/conversation.vala +++ b/libdino/src/entity/conversation.vala @@ -91,15 +91,17 @@ public class Conversation : Object { } public NotifySetting get_notification_setting(StreamInteractor stream_interactor) { + return notify_setting != NotifySetting.DEFAULT ? notify_setting : get_notification_default_setting(stream_interactor); + } + + public NotifySetting get_notification_default_setting(StreamInteractor stream_interactor) { Xmpp.Core.XmppStream? stream = stream_interactor.get_stream(account); - if (notify_setting != NotifySetting.DEFAULT) return notify_setting; if (!Application.get_default().settings.notifications) return NotifySetting.OFF; if (type_ == Type.GROUPCHAT) { bool members_only = stream.get_flag(Xmpp.Xep.Muc.Flag.IDENTITY).has_room_feature(counterpart.bare_jid.to_string(), Xmpp.Xep.Muc.Feature.MEMBERS_ONLY); return members_only ? NotifySetting.ON : NotifySetting.HIGHLIGHT; - } else { - return NotifySetting.ON; } + return NotifySetting.ON; } public Setting get_send_typing_setting() { -- cgit v1.2.3-70-g09d2