aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/entity/conversation.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-05-21 21:42:39 +0200
committerfiaxh <git@lightrise.org>2019-05-26 20:20:09 +0200
commit03f25e1f87dd4608c7cf4d0f97d1cb2e0141094d (patch)
treeedbbef9cad6e0548ea27bb09c988b4717c49cb37 /libdino/src/entity/conversation.vala
parent32687d731f50969545e0122e13c395cfa5f859a1 (diff)
downloaddino-03f25e1f87dd4608c7cf4d0f97d1cb2e0141094d.tar.gz
dino-03f25e1f87dd4608c7cf4d0f97d1cb2e0141094d.zip
Remove Message.stanza field
Diffstat (limited to 'libdino/src/entity/conversation.vala')
-rw-r--r--libdino/src/entity/conversation.vala20
1 files changed, 12 insertions, 8 deletions
diff --git a/libdino/src/entity/conversation.vala b/libdino/src/entity/conversation.vala
index 145dc977..9e8a3406 100644
--- a/libdino/src/entity/conversation.vala
+++ b/libdino/src/entity/conversation.vala
@@ -102,27 +102,31 @@ public class Conversation : Object {
}
public NotifySetting get_notification_default_setting(StreamInteractor stream_interactor) {
- Xmpp.XmppStream? stream = stream_interactor.get_stream(account);
if (!Application.get_default().settings.notifications) return NotifySetting.OFF;
+
if (type_ == Type.GROUPCHAT) {
- Xmpp.Xep.Muc.Flag? flag = stream.get_flag(Xmpp.Xep.Muc.Flag.IDENTITY);
- if (flag != null) {
- bool members_only = flag.has_room_feature(counterpart.bare_jid, Xmpp.Xep.Muc.Feature.MEMBERS_ONLY);
- return members_only ? NotifySetting.ON : NotifySetting.HIGHLIGHT;
+ if (stream_interactor.get_module(MucManager.IDENTITY).is_private_room(this.account, this.counterpart)) {
+ return NotifySetting.ON;
} else {
- return NotifySetting.OFF;
+ return NotifySetting.HIGHLIGHT;
}
}
return NotifySetting.ON;
}
- public Setting get_send_typing_setting() {
+ public Setting get_send_typing_setting(StreamInteractor stream_interactor) {
if (send_typing != Setting.DEFAULT) return send_typing;
+
+ if (stream_interactor.get_module(MucManager.IDENTITY).is_public_room(this.account, this.counterpart)) return Setting.OFF;
+
return Application.get_default().settings.send_typing ? Setting.ON : Setting.OFF;
}
- public Setting get_send_marker_setting() {
+ public Setting get_send_marker_setting(StreamInteractor stream_interactor) {
if (send_marker != Setting.DEFAULT) return send_marker;
+
+ if (stream_interactor.get_module(MucManager.IDENTITY).is_public_room(this.account, this.counterpart)) return Setting.OFF;
+
return Application.get_default().settings.send_marker ? Setting.ON : Setting.OFF;
}