Clickable update notifications

This commit is contained in:
Jaidyn Ann 2021-03-04 18:18:39 -06:00
parent b4cde0e09d
commit ea620f387a

View File

@ -103,12 +103,17 @@ Notifier::_SendUpdatedNotification()
feedNum << fUpdatedFeeds->CountItems(); feedNum << fUpdatedFeeds->CountItems();
notifyText.ReplaceAll("%n%", entryNum); notifyText.ReplaceAll("%n%", entryNum);
notifyText.ReplaceAll("%m%", feedNum); notifyText.ReplaceAll("%m%", feedNum - 1);
notifyText.ReplaceAll("%source%", notifyText.ReplaceAll("%source%",
((BString*)fUpdatedFeeds->ItemAt(0))->String()); ((BString*)fUpdatedFeeds->ItemAt(0))->String());
notifyNew.SetTitle(notifyLabel); notifyNew.SetTitle(notifyLabel);
notifyNew.SetContent(notifyText); notifyNew.SetContent(notifyText);
entry_ref feedsRef;
BEntry(((App*)be_app)->fPreferences->EntryDir()).GetRef(&feedsRef);
notifyNew.SetOnClickFile(&feedsRef);
notifyNew.Send(); notifyNew.Send();
} }
@ -131,7 +136,7 @@ Notifier::_SendFailedNotification()
BString feedNum = ""; BString feedNum = "";
feedNum << fFailedFeeds->CountItems(); feedNum << fFailedFeeds->CountItems();
notifyText.ReplaceAll("%m%", feedNum); notifyText.ReplaceAll("%m%", feedNum - 1);
notifyText.ReplaceAll("%source%", notifyText.ReplaceAll("%source%",
((BString*)fFailedFeeds->ItemAt(0))->String()); ((BString*)fFailedFeeds->ItemAt(0))->String());