feat: restore macOS 10.13 compatibility

This commit is contained in:
relikd
2026-01-11 22:00:48 +01:00
parent 25be1033aa
commit c310933623
11 changed files with 47 additions and 29 deletions

View File

@@ -5,7 +5,7 @@ CODE_SIGN_STYLE = Manual
CODE_SIGN_IDENTITY = Apple Development
ENABLE_HARDENED_RUNTIME = YES
MACOSX_DEPLOYMENT_TARGET = 10.14
MACOSX_DEPLOYMENT_TARGET = 10.13
MARKETING_VERSION = 1.6.1
PRODUCT_NAME = baRSS
PRODUCT_BUNDLE_IDENTIFIER = de.relikd.baRSS

View File

@@ -1,4 +1,4 @@
[![macOS 10.14+](https://img.shields.io/badge/macOS-10.14+-888)](#download--install)
[![macOS 10.13+](https://img.shields.io/badge/macOS-10.13+-888)](#download--install)
[![Current release](https://img.shields.io/github/release/relikd/baRSS)](https://github.com/relikd/baRSS/releases)
[![All downloads](https://img.shields.io/github/downloads/relikd/baRSS/total)](https://github.com/relikd/baRSS/releases)
[![GitHub license](https://img.shields.io/github/license/relikd/baRSS)](LICENSE)
@@ -35,7 +35,7 @@ Further, tuning the update frequently will decrease the traffic even more.
Download & Install
------------------
Requires macOS Mojave (10.14) or higher.
Requires macOS High Sierra (10.13) or higher.
### Easy way
Go to [releases](https://github.com/relikd/baRSS/releases) and downloaded the latest version.

View File

@@ -47,10 +47,12 @@
if (initial) [UpdateScheduler updateAllFavicons];
}
if (@available(macOS 10.14, *)) {
// Notifications are disabled by default so this wont trigger for first app launch.
// Also, this will register the notification delegate and respond to click & open feed.
[NotifyEndpoint activate];
}
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
[UpdateScheduler unregisterNetworkChangeNotification];

View File

@@ -129,8 +129,10 @@
if (deletingSet.count > 0) {
[localSet minusSet:deletingSet];
[self removeArticles:deletingSet];
if (@available(macOS 10.14, *)) {
[NotifyEndpoint dismiss:dismissed];
}
}
return c;
}

View File

@@ -91,8 +91,10 @@
NSNumber *num = (fa.unread ? @+1 : @-1);
PostNotification(kNotificationTotalUnreadCountChanged, num);
if (@available(macOS 10.14, *)) {
[NotifyEndpoint dismiss:fa.feed.countUnread > 0 ? @[fa.notificationID] : @[fa.notificationID, fa.feed.notificationID]];
}
}
[moc reset];
}

View File

@@ -211,6 +211,7 @@ static inline void AlertDownloadError(NSError *err, NSString *url) {
// after save, update notifications
// dismiss previously delivered notifications
if (@available(macOS 10.14, *)) {
if (deleted) {
NSMutableArray *ids = [NSMutableArray array];
for (FeedArticle *article in deleted) { // will contain non-articles too
@@ -232,6 +233,7 @@ static inline void AlertDownloadError(NSError *err, NSString *url) {
if (didAddAny)
[NotifyEndpoint postFeed:f];
}
}
if (needsNotification)
PostNotification(kNotificationArticlesUpdated, oid);

View File

@@ -5,6 +5,7 @@
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(macos(10.14))
@interface NotifyEndpoint : NSObject <UNUserNotificationCenterDelegate>
+ (void)activate;

View File

@@ -18,6 +18,7 @@ static NSString* const kActionOpenOnly = @"OPEN_ONLY_DONT_MARK_READ";
@implementation NotifyEndpoint
API_AVAILABLE(macos(10.14))
static NotifyEndpoint *singleton = nil;
static NotificationType notifyType;

View File

@@ -86,8 +86,10 @@
- (void)changeNotificationType:(NSPopUpButton *)sender {
UserPrefsSet(Pref_notificationType, sender.selectedItem.representedObject);
self.view.notificationHelp.stringValue = [self notificationHelpString:UserPrefsNotificationType()];
if (@available(macOS 10.14, *)) {
[NotifyEndpoint activate];
}
}
/// Help string explaining the different notification settings (for the current configuration)
- (NSString*)notificationHelpString:(NotificationType)typ {

View File

@@ -77,8 +77,10 @@
NSInteger oldCount = _unreadCountTotal;
_unreadCountTotal = count > 0 ? (NSInteger)count : 0;
[self updateBarIcon];
if (@available(macOS 10.14, *)) {
[NotifyEndpoint setGlobalCount:_unreadCountTotal previousCount:oldCount];
}
}
/// Assign new value by adding @c count to total unread count (may be negative).
- (void)setUnreadCountRelative:(NSInteger)count {
@@ -88,8 +90,10 @@
_unreadCountTotal = 0;
}
[self updateBarIcon];
if (@available(macOS 10.14, *)) {
[NotifyEndpoint setGlobalCount:_unreadCountTotal previousCount:oldCount];
}
}
/// Fetch new total unread count from core data and assign it as new value (dispatch async on main thread).
- (void)asyncReloadUnreadCount {

View File

@@ -206,8 +206,10 @@ typedef NS_ENUM(NSInteger, MenuItemTag) {
}
NSManagedObjectContext *moc = [StoreCoordinator createChildContext];
NSArray<FeedArticle*> *list = [StoreCoordinator articlesAtPath:path isFeed:isFeedMenu sorted:openLinks unread:markRead inContext:moc limit:limit];
[NotifyEndpoint dismiss:
[StoreCoordinator updateArticles:list markRead:markRead andOpen:openLinks inContext:moc]];
NSArray<NSString *> *notificationIds = [StoreCoordinator updateArticles:list markRead:markRead andOpen:openLinks inContext:moc];
if (@available(macOS 10.14, *)) {
[NotifyEndpoint dismiss:notificationIds];
}
}
@end