Update the notification item in day_edit_item()
Ensure the start time as well as the description of the notification appointment are synced after editing it. We use notify_check_next_app()'s force parameter to ensure that the notification item is updated even if only the description was modified. Reported-by: Andraž 'ruskie' Levstik <ruskie@codemages.net> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
5a5c6d2604
commit
cce0acbe00
11
src/day.c
11
src/day.c
@ -772,6 +772,7 @@ day_edit_item (struct conf *conf)
|
|||||||
struct apoint *a;
|
struct apoint *a;
|
||||||
long date;
|
long date;
|
||||||
int item_num, ch;
|
int item_num, ch;
|
||||||
|
int need_check_notify = 0;
|
||||||
|
|
||||||
item_num = apoint_hilt ();
|
item_num = apoint_hilt ();
|
||||||
p = day_get_item (item_num);
|
p = day_get_item (item_num);
|
||||||
@ -811,15 +812,19 @@ day_edit_item (struct conf *conf)
|
|||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case STRT:
|
case STRT:
|
||||||
|
need_check_notify = 1;
|
||||||
update_start_time (&ra->start, &ra->dur);
|
update_start_time (&ra->start, &ra->dur);
|
||||||
break;
|
break;
|
||||||
case END:
|
case END:
|
||||||
update_duration (&ra->start, &ra->dur);
|
update_duration (&ra->start, &ra->dur);
|
||||||
break;
|
break;
|
||||||
case DESC:
|
case DESC:
|
||||||
|
if (notify_bar ())
|
||||||
|
need_check_notify = notify_same_recur_item (ra);
|
||||||
update_desc (&ra->mesg);
|
update_desc (&ra->mesg);
|
||||||
break;
|
break;
|
||||||
case REPT:
|
case REPT:
|
||||||
|
need_check_notify = 1;
|
||||||
update_rept (&ra->rpt, ra->start, conf);
|
update_rept (&ra->rpt, ra->start, conf);
|
||||||
break;
|
break;
|
||||||
case KEY_GENERIC_CANCEL:
|
case KEY_GENERIC_CANCEL:
|
||||||
@ -835,12 +840,15 @@ day_edit_item (struct conf *conf)
|
|||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
case STRT:
|
case STRT:
|
||||||
|
need_check_notify = 1;
|
||||||
update_start_time (&a->start, &a->dur);
|
update_start_time (&a->start, &a->dur);
|
||||||
break;
|
break;
|
||||||
case END:
|
case END:
|
||||||
update_duration (&a->start, &a->dur);
|
update_duration (&a->start, &a->dur);
|
||||||
break;
|
break;
|
||||||
case DESC:
|
case DESC:
|
||||||
|
if (notify_bar ())
|
||||||
|
need_check_notify = notify_same_item (a->start);
|
||||||
update_desc (&a->mesg);
|
update_desc (&a->mesg);
|
||||||
break;
|
break;
|
||||||
case KEY_GENERIC_CANCEL:
|
case KEY_GENERIC_CANCEL:
|
||||||
@ -848,6 +856,9 @@ day_edit_item (struct conf *conf)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (need_check_notify)
|
||||||
|
notify_check_next_app (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user