From ea620f387a1f3b206b63e797f70d8fad1fe1afcf Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Thu, 4 Mar 2021 18:18:39 -0600 Subject: [PATCH] Clickable update notifications --- src/Notifier.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Notifier.cpp b/src/Notifier.cpp index 1f22592..119176a 100644 --- a/src/Notifier.cpp +++ b/src/Notifier.cpp @@ -103,12 +103,17 @@ Notifier::_SendUpdatedNotification() feedNum << fUpdatedFeeds->CountItems(); notifyText.ReplaceAll("%n%", entryNum); - notifyText.ReplaceAll("%m%", feedNum); + notifyText.ReplaceAll("%m%", feedNum - 1); notifyText.ReplaceAll("%source%", ((BString*)fUpdatedFeeds->ItemAt(0))->String()); notifyNew.SetTitle(notifyLabel); notifyNew.SetContent(notifyText); + + entry_ref feedsRef; + BEntry(((App*)be_app)->fPreferences->EntryDir()).GetRef(&feedsRef); + notifyNew.SetOnClickFile(&feedsRef); + notifyNew.Send(); } @@ -131,7 +136,7 @@ Notifier::_SendFailedNotification() BString feedNum = ""; feedNum << fFailedFeeds->CountItems(); - notifyText.ReplaceAll("%m%", feedNum); + notifyText.ReplaceAll("%m%", feedNum - 1); notifyText.ReplaceAll("%source%", ((BString*)fFailedFeeds->ItemAt(0))->String());