From 6f6640f0516bbd24a5cd3aaf268aa94424d84f88 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 9 Dec 2024 19:28:20 +0100 Subject: [PATCH] apply logic for reactions and webxdc-notifications --- DcNotificationService/NotificationService.swift | 4 ++-- deltachat-ios/Helper/NotificationManager.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DcNotificationService/NotificationService.swift b/DcNotificationService/NotificationService.swift index 5c1e3b2b8..a1335a2b1 100644 --- a/DcNotificationService/NotificationService.swift +++ b/DcNotificationService/NotificationService.swift @@ -76,7 +76,7 @@ class NotificationService: UNNotificationServiceExtension { if !dcContext.isMuted() { let msg = dcContext.getMessage(id: event.data2Int) let chat = dcContext.getChat(chatId: msg.chatId) - if !chat.isMuted { + if !chat.isMuted || (chat.isGroup && dcContext.isMentionsEnabled()) { let sender = dcContext.getContact(id: event.data1Int).displayName let summary = (msg.summary(chars: 80) ?? "") bestAttemptContent.title = chat.name @@ -94,7 +94,7 @@ class NotificationService: UNNotificationServiceExtension { if !dcContext.isMuted() { let msg = dcContext.getMessage(id: event.data2Int) let chat = dcContext.getChat(chatId: msg.chatId) - if !chat.isMuted { + if !chat.isMuted || (chat.isGroup && dcContext.isMentionsEnabled()) { bestAttemptContent.title = chat.name bestAttemptContent.body = msg.getWebxdcAppName() + ": " + event.data2String bestAttemptContent.userInfo["account_id"] = dcContext.id diff --git a/deltachat-ios/Helper/NotificationManager.swift b/deltachat-ios/Helper/NotificationManager.swift index 3e0f3bb92..fe292460b 100644 --- a/deltachat-ios/Helper/NotificationManager.swift +++ b/deltachat-ios/Helper/NotificationManager.swift @@ -136,7 +136,7 @@ public class NotificationManager { if !eventContext.isMuted() { let msg = eventContext.getMessage(id: ui["msg_id"] as? Int ?? 0) let chat = eventContext.getChat(chatId: msg.chatId) - if !chat.isMuted { + if !chat.isMuted || (chat.isGroup && dcContext.isMentionsEnabled()) { let contact = eventContext.getContact(id: ui["contact_id"] as? Int ?? 0) let summary = (msg.summary(chars: 80) ?? "") let reaction = ui["reaction"] as? String ?? "" @@ -168,7 +168,7 @@ public class NotificationManager { if !eventContext.isMuted() { let msg = eventContext.getMessage(id: ui["msg_id"] as? Int ?? 0) let chat = eventContext.getChat(chatId: msg.chatId) - if !chat.isMuted { + if !chat.isMuted || (chat.isGroup && dcContext.isMentionsEnabled()) { let content = UNMutableNotificationContent() content.title = chat.name content.body = msg.getWebxdcAppName() + ": " + (ui["text"] as? String ?? "")