Skip to content

Commit

Permalink
respect mention setting for reactions and webxdc-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Dec 9, 2024
1 parent 0e305c7 commit 1963274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DcNotificationService/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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 || dcContext.isMentionsEnabled() {
let sender = dcContext.getContact(id: event.data1Int).displayName
let summary = (msg.summary(chars: 80) ?? "")
bestAttemptContent.title = chat.name
Expand All @@ -76,7 +76,7 @@ class NotificationService: UNNotificationServiceExtension {
}
} else if event.id == DC_EVENT_INCOMING_WEBXDC_NOTIFY {
let dcContext = dcAccounts.get(id: event.accountId)
if !dcContext.isMuted() {
if !dcContext.isMuted() || dcContext.isMentionsEnabled() {
let msg = dcContext.getMessage(id: event.data2Int)
let chat = dcContext.getChat(chatId: msg.chatId)
if !chat.isMuted {
Expand Down
4 changes: 2 additions & 2 deletions deltachat-ios/Helper/NotificationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 || 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 ?? ""
Expand Down Expand Up @@ -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 || dcContext.isMentionsEnabled() {
let content = UNMutableNotificationContent()
content.title = chat.name
content.body = msg.getWebxdcAppName() + ": " + (ui["text"] as? String ?? "")
Expand Down

0 comments on commit 1963274

Please sign in to comment.