Forráskód Böngészése

check if chat is muted before creating notifications

cyberta 5 éve
szülő
commit
0a9363163d
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      DcCore/DcCore/DC/events.swift

+ 3 - 1
DcCore/DcCore/DC/events.swift

@@ -119,7 +119,9 @@ public func handleEvent(event: DcEvent) {
                     object: nil,
                     userInfo: userInfo)
 
-            if !UserDefaults.standard.bool(forKey: "notifications_disabled") {
+            let chat = DcContext.shared.getChat(chatId: Int(data1))
+            if !UserDefaults.standard.bool(forKey: "notifications_disabled") && !chat.isMuted
+                {
                 let content = UNMutableNotificationContent()
                 let msg = DcMsg(id: Int(data2))
                 content.title = msg.fromContact.displayName