summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2017-02-11 11:50:32 +0100
committerLukas Fleischer <lfleischer@calcurse.org>2017-02-11 11:50:51 +0100
commit5aa7a0962a2728e6b2164c4531d3995b33cb71b8 (patch)
treea505e2312e530adcb703761a25a90ae7f714cbb8 /src
parent2084f353e3d224bbc21148f25ab2f2539892d386 (diff)
downloadcalcurse-5aa7a0962a2728e6b2164c4531d3995b33cb71b8.zip
Fix another error in the notification code
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>
Diffstat (limited to 'src')
-rw-r--r--src/recur.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/recur.c b/src/recur.c
index 95a45ca..2a62e94 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -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;