diff options
author | fiaxh <git@mx.ax.lt> | 2017-08-24 17:24:22 +0200 |
---|---|---|
committer | fiaxh <git@mx.ax.lt> | 2017-08-25 22:30:03 +0200 |
commit | a8ba4a397419b3b6d3d167b21a8da72dcdbe1961 (patch) | |
tree | d3042a2145cf2440a467880b533ae0deacef3e9a /libdino/src/entity | |
parent | 5fcf8e73efeea60413a383e6e6a096a3981be1a2 (diff) | |
download | dino-a8ba4a397419b3b6d3d167b21a8da72dcdbe1961.tar.gz dino-a8ba4a397419b3b6d3d167b21a8da72dcdbe1961.zip |
"Default" per-contact settings (change UI)
Diffstat (limited to 'libdino/src/entity')
-rw-r--r-- | libdino/src/entity/conversation.vala | 8 |
1 files changed, 5 insertions, 3 deletions
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() { |