From fe75ad22c4ab2b0dd1ea433c249ec3471da0bfd7 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Wed, 25 May 2022 20:25:58 -0400 Subject: [PATCH] Only handle message events --- ntfyNSE/NotificationService.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ntfyNSE/NotificationService.swift b/ntfyNSE/NotificationService.swift index a549eaa..6dd7b52 100644 --- a/ntfyNSE/NotificationService.swift +++ b/ntfyNSE/NotificationService.swift @@ -23,12 +23,19 @@ class NotificationService: UNNotificationServiceExtension { let userInfo = bestAttemptContent.userInfo // Get all the things + let event = userInfo["event"] as? String ?? "" let topic = userInfo["topic"] as? String ?? "" let title = userInfo["title"] as? String let priority = userInfo["priority"] as? String ?? "3" let tags = userInfo["tags"] as? String let actions = userInfo["actions"] as? String ?? "[]" + // Only handle "message" events + if event != "message" { + contentHandler(request.content) + return + } + // Set notification title to short URL if there is no title. The title is always set // by the server, but it may be empty. if let title = title, title == "" {