diff options
Diffstat (limited to 'src/feeds.c')
-rw-r--r-- | src/feeds.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/feeds.c b/src/feeds.c index 9538d948..1af42477 100644 --- a/src/feeds.c +++ b/src/feeds.c | |||
@@ -259,7 +259,7 @@ static const iPtrArray *listSubscriptions_(void) { | |||
259 | 259 | ||
260 | static iBool startWorker_Feeds_(iFeeds *d) { | 260 | static iBool startWorker_Feeds_(iFeeds *d) { |
261 | if (d->worker) { | 261 | if (d->worker) { |
262 | return iFalse; /* Oops? */ | 262 | return iFalse; /* Refresh is already ongoing. */ |
263 | } | 263 | } |
264 | /* Queue up all the subscriptions for the worker. */ | 264 | /* Queue up all the subscriptions for the worker. */ |
265 | iConstForEach(PtrArray, i, listSubscriptions_()) { | 265 | iConstForEach(PtrArray, i, listSubscriptions_()) { |
@@ -449,6 +449,14 @@ void deinit_Feeds(void) { | |||
449 | deinit_SortedArray(&d->entries); | 449 | deinit_SortedArray(&d->entries); |
450 | } | 450 | } |
451 | 451 | ||
452 | void refresh_Feeds(void) { | ||
453 | startWorker_Feeds_(&feeds_); | ||
454 | } | ||
455 | |||
456 | void refreshFinished_Feeds(void) { | ||
457 | stopWorker_Feeds_(&feeds_); | ||
458 | } | ||
459 | |||
452 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { | 460 | static int cmpTimeDescending_FeedEntryPtr_(const void *a, const void *b) { |
453 | const iFeedEntry * const *e1 = a, * const *e2 = b; | 461 | const iFeedEntry * const *e1 = a, * const *e2 = b; |
454 | return -cmp_Time(&(*e1)->timestamp, &(*e2)->timestamp); | 462 | return -cmp_Time(&(*e1)->timestamp, &(*e2)->timestamp); |
@@ -470,7 +478,7 @@ const iPtrArray *listEntries_Feeds(void) { | |||
470 | const iString *entryListPage_Feeds(void) { | 478 | const iString *entryListPage_Feeds(void) { |
471 | iFeeds *d = &feeds_; | 479 | iFeeds *d = &feeds_; |
472 | iString *src = collectNew_String(); | 480 | iString *src = collectNew_String(); |
473 | format_String(src, "# Aggregated Gemini feeds\n"); | 481 | format_String(src, "# Feed entries\n\n"); |
474 | lock_Mutex(d->mtx); | 482 | lock_Mutex(d->mtx); |
475 | const iPtrArray *subs = listSubscriptions_(); | 483 | const iPtrArray *subs = listSubscriptions_(); |
476 | int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; | 484 | int elapsed = elapsedSeconds_Time(&d->lastRefreshedAt) / 60; |