summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-05-29 19:49:45 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-05-29 20:15:47 +0200
commit1212e5b317893e80828c688c42eba1b442b39248 (patch)
treec57413b698e5a5b322fcde088b4703376c8ffea0 /src
parentEnable sending notifications via the systemNotification signal on macOS (diff)
downloadnheko-1212e5b317893e80828c688c42eba1b442b39248.tar.xz
Copy arguments for notification
Diffstat (limited to 'src')
-rw-r--r--src/notifications/Manager.h12
-rw-r--r--src/notifications/ManagerMac.mm14
2 files changed, 13 insertions, 13 deletions
diff --git a/src/notifications/Manager.h b/src/notifications/Manager.h
index e200e8be..bc37dbd8 100644
--- a/src/notifications/Manager.h
+++ b/src/notifications/Manager.h
@@ -75,12 +75,12 @@ private:
 private:
     // Objective-C(++) doesn't like to do lots of regular C++, so the actual notification
     // posting is split out
-    void objCxxPostNotification(const QString &room_name,
-                                const QString &room_id,
-                                const QString &event_id,
-                                const QString &subtitle,
-                                const QString &informativeText,
-                                const QString &bodyImagePath,
+    void objCxxPostNotification(const QString room_name,
+                                const QString room_id,
+                                const QString event_id,
+                                const QString subtitle,
+                                const QString informativeText,
+                                const QString bodyImagePath,
                                 const bool playSound);
 
     QString respondStr;
diff --git a/src/notifications/ManagerMac.mm b/src/notifications/ManagerMac.mm
index 8578b675..73d4287f 100644
--- a/src/notifications/ManagerMac.mm
+++ b/src/notifications/ManagerMac.mm
@@ -62,12 +62,12 @@
 @end
 
 void NotificationsManager::objCxxPostNotification(
-    const QString& room_name,
-    const QString& room_id,
-    const QString& event_id,
-    const QString& subtitle,
-    const QString& informativeText,
-    const QString& bodyImagePath,
+    const QString room_name,
+    const QString room_id,
+    const QString event_id,
+    const QString subtitle,
+    const QString informativeText,
+    const QString bodyImagePath,
     const bool enableSound)
 {
     // Request permissions for alerts (the generic type of notification), sound playback,
@@ -114,7 +114,7 @@ void NotificationsManager::objCxxPostNotification(
     NSString* identifier = event_id.toNSString();
     NSString* imgUrl = bodyImagePath.toNSString();
 
-    NSSet* categories = [NSSet setWithObjects:summaryCategory, replyCategory, nil];
+    NSSet* categories = [NSSet setWithArray:@[ summaryCategory, replyCategory ]];
     [center setNotificationCategories:categories];
     [center getNotificationSettingsWithCompletionHandler:^(
         UNNotificationSettings* _Nonnull settings) {