path: root/src/args.c
diff options
authorLars Henriksen <LarsHenriksen@get2net.dk>2018-07-15 10:30:41 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2019-01-11 18:11:52 +0100
commit8cbd4566405dfac11d723df5c4bb85a679ef8dbf (patch)
tree16d79fe28313f0d28f045a4c8cf470b968604a7c /src/args.c
parentf2ca5980e9ec27f94684088c153a218f08f8176e (diff)
Fix next recurring appointment
Recurring appointments do not show up in the notification bar as next appointment. This was partly corrected by 2084f35 (Fix notification of recurrent appointments, 2017-02-09) and 5aa7a09 (Fix another error in the notification code, 2017-02-11). The search function recur_apoint_starts_before() had a wrong second argument, but is really of no use: the start time of a recurring appointment is the start time of the very first occurrence (in the past). A comparison against the item in the notify_app structure tells nothing of the start time of the current day; at most it eliminates some future recurring appointments. The function can be dropped, and the entire recurring appointment list looked through. The proper start time is found in the main search loop (and called real_recur_start_time) and must be compared against the item in the notify_app structure. But because recur_apoint_find_occurrence() is limited to a particular day (second argument), two searches are necessary to cover 24 hours. Unrelated cleanups: removed function return value; changed long to time_t. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/args.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/src/args.c b/src/args.c
index 52496cd..8443454 100644
--- a/src/args.c
+++ b/src/args.c
@@ -231,8 +231,7 @@ static void next_arg(void)
next_app.got_app = 0;
next_app.txt = NULL;
- next_app = *recur_apoint_check_next(&next_app, current_time,
- get_today());
+ recur_apoint_check_next(&next_app, current_time, get_today());
next_app = *apoint_check_next(&next_app, current_time);
if (next_app.got_app) {