From 29c012973113063ecee92e05d40efe5d0389953a Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 4 Jul 2024 16:22:06 +0200 Subject: [PATCH] also send notification when recurrences are added or removed --- calendar/inc/class.calendar_boupdate.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 6b86c0e16d..ac6dd75fb3 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -577,7 +577,8 @@ class calendar_boupdate extends calendar_bo $modified = $added = $deleted = array(); //echo "

calendar_boupdate::check4update() new participants = ".print_r($new_event['participants'],true).", old participants =".print_r($old_event['participants'],true)."

\n"; - foreach(['start','end','tz_id','owner','category','priority','public','title','description','location'] as $field) + foreach(['start','end','tz_id','owner','category','priority','public','title','description','location', + 'recur_exception','recur_rdates', 'recur_enddate'] as $field) { if($new_event[$field] !== $old_event[$field]) { @@ -628,7 +629,7 @@ class calendar_boupdate extends calendar_bo * checks if $userid has requested (in $part_prefs) updates for $msg_type * * @param int $userid numerical user-id - * @param array $part_prefs preferces of the user $userid + * @param array $part_prefs preferences of the user $userid * @param int &$msg_type type of the notification: MSG_ADDED, MSG_MODIFIED, MSG_ACCEPTED, ... * @param array $old_event Event before the change * @param array $new_event Event after the change @@ -701,7 +702,11 @@ class calendar_boupdate extends calendar_bo $diff = max(abs(self::date2ts($old_event['start']??null)-self::date2ts($new_event['start']??null)), abs(self::date2ts($old_event['end']??null)-self::date2ts($new_event['end']??null))); $check = $ru == 'time_change_4h' ? 4 * 60 * 60 - 1 : 0; - if ($msg_type == MSG_MODIFIED && $diff > $check) + if ($msg_type == MSG_MODIFIED && ($diff > $check || + // also notify if recurrences where added or removed + $old_event['recur_exception'] != $new_event['recur_exception'] || + $old_event['recur_rdates'] != $new_event['recur_rdates'] || + $old_event['recur_enddate'] != $new_event['recur_enddate'])) { ++$want_update; }