Fix next recurrent appointment deleted

If the notify bar displays a recurrent appointment after midnight as next
upcoming appointment, the bar is not updated when the appointment/occurrence is
deleted.  The problem is not seen in 4.3.0 because of the bug described in
commit 8cbd456, Fix next recurring appointment.  The problem and the solution is
the same, this time in the function notify_same_recur_item().

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lars Henriksen 2019-12-11 09:57:02 +01:00 committed by Lukas Fleischer
parent b7eb9a9e94
commit a0129d6751

View File

@ -537,11 +537,20 @@ int notify_same_item(time_t time)
return same;
}
/*
* Check if an occurrence of a recurrent appointment is currently the "next
* upcoming appointment" in the notify bar.
*/
int notify_same_recur_item(struct recur_apoint *i)
{
int same = 0;
time_t item_start = 0;
time_t item_start;
/* Tomorrow? */
recur_item_find_occurrence(i->start, i->dur, &i->exc, i->rpt->type,
i->rpt->freq, i->rpt->until,
NEXTDAY(get_today()), &item_start);
/* Today? */
recur_item_find_occurrence(i->start, i->dur, &i->exc, i->rpt->type,
i->rpt->freq, i->rpt->until,
get_today(), &item_start);