From d164c6bcb0ae4c80dd698319f3c1630dfb124133 Mon Sep 17 00:00:00 2001 From: relikd Date: Sun, 26 Oct 2025 23:36:15 +0100 Subject: [PATCH] feat: use format "feed title: article title" --- baRSS.xcodeproj/project.pbxproj | 4 ++-- baRSS/Notifications/NotifyEndpoint.m | 10 +++++----- baRSS/Preferences/General Tab/SettingsGeneral.m | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/baRSS.xcodeproj/project.pbxproj b/baRSS.xcodeproj/project.pbxproj index 742d639..dd82211 100644 --- a/baRSS.xcodeproj/project.pbxproj +++ b/baRSS.xcodeproj/project.pbxproj @@ -805,7 +805,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 16684; + CURRENT_PROJECT_VERSION = 16686; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UY657LKNHJ; @@ -866,7 +866,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 16684; + CURRENT_PROJECT_VERSION = 16686; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = UY657LKNHJ; diff --git a/baRSS/Notifications/NotifyEndpoint.m b/baRSS/Notifications/NotifyEndpoint.m index 4a1be4d..dd4a568 100644 --- a/baRSS/Notifications/NotifyEndpoint.m +++ b/baRSS/Notifications/NotifyEndpoint.m @@ -55,7 +55,7 @@ static NotificationType notifyType; // or update count and show a new notification banner? if (newCount > oldCount) { // only notify if new feeds (quirk: will also trigger for option-click menu to mark unread) [self send:kNotifyIdGlobal - title:nil + title:APP_NAME body:[NSString stringWithFormat:@"%ld unread articles", newCount]]; } } else { @@ -84,8 +84,8 @@ static NotificationType notifyType; } [article.managedObjectContext obtainPermanentIDsForObjects:@[article] error:nil]; [self send:article.notificationID - title:article.title - body:article.abstract ? article.abstract : article.body]; + title:article.feed.title + body:article.title]; } /// Close already posted notifications because they were opened via menu @@ -102,8 +102,8 @@ static NotificationType notifyType; /// @param identifier Used to identify a specific instance (and dismiss a previously shown notification). + (void)send:(NSString *)identifier title:(nullable NSString *)title body:(nullable NSString *)body { UNMutableNotificationContent *msg = [UNMutableNotificationContent new]; - if (title) msg.title = title; - if (body) msg.body = body; + if (title != nil) msg.title = title; + if (body != nil) msg.body = body; // common settings: // TODO: make sound configurable? msg.sound = [UNNotificationSound defaultSound]; diff --git a/baRSS/Preferences/General Tab/SettingsGeneral.m b/baRSS/Preferences/General Tab/SettingsGeneral.m index 8c524a4..6657492 100644 --- a/baRSS/Preferences/General Tab/SettingsGeneral.m +++ b/baRSS/Preferences/General Tab/SettingsGeneral.m @@ -95,7 +95,7 @@ case NotificationTypeDisabled: return NSLocalizedString(@"Notifications are disabled. You will not get any notifications even if you enable them in System Settings.", nil); case NotificationTypePerArticle: - return NSLocalizedString(@"You will get a notification for each article (“Article Title: Article Content”). A click on the notification banner opens the article link and marks the item as read.", nil); + return NSLocalizedString(@"You will get a notification for each article (“Feed Title: Article Title”). A click on the notification banner opens the article link and marks the item as read.", nil); case NotificationTypePerFeed: return NSLocalizedString(@"You will get a notification for each feed whenever one or more new articles are published (“Feed Title: X unread articles”). A click on the notification banner will open all unread articles of that feed.", nil); case NotificationTypeGlobal: