Skip to content

Commit

Permalink
apply logic for reactions and webxdc-notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Jan 7, 2025
1 parent 6bf2179 commit 6f6640f
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 @@ -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
Expand All @@ -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
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 || (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 ?? ""
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 || (chat.isGroup && dcContext.isMentionsEnabled()) {
let content = UNMutableNotificationContent()
content.title = chat.name
content.body = msg.getWebxdcAppName() + ": " + (ui["text"] as? String ?? "")
Expand Down

0 comments on commit 6f6640f

Please sign in to comment.