Skip to content

Commit

Permalink
Fix another error in the notification code
Browse files Browse the repository at this point in the history
In addition to checking whether a recurrent item predates the current
next appointment, we need to check that the actual occurrence of the
item predates the current appointment as well.

Fixes GitHub issue #26.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
  • Loading branch information
Lukas Fleischer committed Feb 11, 2017
1 parent 2084f35 commit 5aa7a09
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/recur.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,9 +943,14 @@ struct notify_app *recur_apoint_check_next(struct notify_app *app,
recur_apoint_starts_before, i) {
struct recur_apoint *rapt = LLIST_TS_GET_DATA(i);

/*
* Check whether the recurrent appointment contains an
* occurrence which is the next item to be notified.
*/
if (recur_apoint_find_occurrence
(rapt, day, &real_recur_start_time)
&& real_recur_start_time > start) {
&& real_recur_start_time > start
&& real_recur_start_time < app->time) {
app->time = real_recur_start_time;
app->txt = mem_strdup(rapt->mesg);
app->state = rapt->state;
Expand Down

0 comments on commit 5aa7a09

Please sign in to comment.