aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorfiaxh <fiaxh@users.noreply.github.com>2019-05-16 09:58:05 -0600
committerGitHub <noreply@github.com>2019-05-16 09:58:05 -0600
commit951be638f6596e9156dd087c310837cfeda242b3 (patch)
tree86193115a8b50b589f3a0eaaff1ac14f2fa2a9bc /libdino
parent9d19cdbf4ec5109f078193daf6ab55df6f69ec93 (diff)
parent7ff99104d2d95ece9ad78fb718aed5c023e66714 (diff)
downloaddino-951be638f6596e9156dd087c310837cfeda242b3.tar.gz
dino-951be638f6596e9156dd087c310837cfeda242b3.zip
Merge pull request #560 from Rahix/fix-notifications
Fix notifications
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/notification_events.vala9
1 files changed, 8 insertions, 1 deletions
diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala
index 010341e3..ea95278d 100644
--- a/libdino/src/service/notification_events.vala
+++ b/libdino/src/service/notification_events.vala
@@ -44,7 +44,12 @@ public class NotificationEvents : StreamInteractionModule, Object {
}
private void on_content_item_received(ContentItem item, Conversation conversation) {
- if (!synced_accounts.contains(conversation.account)) {
+ bool is_mam_message = true;
+ if (item.type_ == MessageItem.TYPE) {
+ // If this message is not for MAM, always notify
+ is_mam_message = Xep.MessageArchiveManagement.MessageFlag.get_flag((item as MessageItem).message.stanza) != null;
+ }
+ if (!synced_accounts.contains(conversation.account) && is_mam_message) {
if (!mam_potential_new.has_key(conversation.account)) {
mam_potential_new[conversation.account] = new HashMap<Conversation, ContentItem>(Conversation.hash_func, Conversation.equals_func);
}
@@ -65,6 +70,8 @@ public class NotificationEvents : StreamInteractionModule, Object {
break;
case FileItem.TYPE:
FileTransfer file_transfer = (content_item as FileItem).file_transfer;
+ // Don't notify on file transfers in a groupchat set to "mention only"
+ if (notify == Conversation.NotifySetting.HIGHLIGHT) return false;
if (file_transfer.direction == FileTransfer.DIRECTION_SENT) return false;
break;
}