Explorar o código

check if chat is muted before creating notifications

cyberta %!s(int64=5) %!d(string=hai) anos
pai
achega
0a9363163d
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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