protected function processICalendarChange($oldObject = null, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false)
    {
        $broker = new ITip\Broker();
        $messages = $broker->parseEvent($newObject, $addresses, $oldObject);

        if ($messages) {
            $modified = true;
        }

        foreach ($messages as $message) {
            if (in_array($message->recipient, $ignore)) {
                continue;
            }

            $this->deliver($message);

            if (isset($newObject->VEVENT->ORGANIZER) && ($newObject->VEVENT->ORGANIZER->getNormalizedValue() === $message->recipient)) {
                if ($message->scheduleStatus) {
                    $newObject->VEVENT->ORGANIZER['SCHEDULE-STATUS'] = $message->getScheduleStatus();
                }
                unset($newObject->VEVENT->ORGANIZER['SCHEDULE-FORCE-SEND']);
            } else {
                if (isset($newObject->VEVENT->ATTENDEE)) {
                    foreach ($newObject->VEVENT->ATTENDEE as $attendee) {
                        if ($attendee->getNormalizedValue() === $message->recipient) {
                            if ($message->scheduleStatus) {
                                $attendee['SCHEDULE-STATUS'] = $message->getScheduleStatus();
                            }
                            unset($attendee['SCHEDULE-FORCE-SEND']);
                            break;
                        }
                    }
                }
            }
        }
    }
protected function processICalendarChange($oldObject = null, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false)
    {
        $broker = new ITip\Broker();
        $messages = $broker->parseEvent($newObject, $addresses, $oldObject);

        if ($messages) {
            $modified = true;
        }

        foreach ($messages as $message) {
            if (in_array($message->recipient, $ignore)) {
                continue;
            }

            $this->deliver($message);

            if (isset($newObject->VEVENT->ORGANIZER) && ($newObject->VEVENT->ORGANIZER->getNormalizedValue() === $message->recipient)) {
                if ($message->scheduleStatus) {
                    $newObject->VEVENT->ORGANIZER['SCHEDULE-STATUS'] = $message->getScheduleStatus();
                }
                unset($newObject->VEVENT->ORGANIZER['SCHEDULE-FORCE-SEND']);
            } else {
                if (isset($newObject->VEVENT->ATTENDEE)) {
                    foreach ($newObject->VEVENT->ATTENDEE as $attendee) {
                        if ($attendee->getNormalizedValue() === $message->recipient) {
                            if ($message->scheduleStatus) {
                                $attendee['SCHEDULE-STATUS'] = $message->getScheduleStatus();
                            }
                            unset($attendee['SCHEDULE-FORCE-SEND']);
                            break;
                        }
                    }
                }
            }
        }
    }
protected function processICalendarChange ( $ oldObject = null , VCalendar $ newObject , array $ addresses , array $ ignore = [ ] , & $ modified = false ) { $ broker = new ITip \ Broker ( ) ; $ messages = $ broker -> parseEvent ( $ newObject , $ addresses , $ oldObject ) ; if ( $ messages ) { $ modified = true ; } foreach ( $ messages as $ message ) { if ( in_array ( $ message -> recipient , $ ignore ) ) { continue ; } $ this -> deliver ( $ message ) ; if ( isset ( $ newObject -> VEVENT -> ORGANIZER ) && ( $ newObject -> VEVENT -> ORGANIZER -> getNormalizedValue ( ) === $ message -> recipient ) ) { if ( $ message -> scheduleStatus ) { $ newObject -> VEVENT -> ORGANIZER [ 'SCHEDULE-STATUS' ] = $ message -> getScheduleStatus ( ) ; } unset ( $ newObject -> VEVENT -> ORGANIZER [ 'SCHEDULE-FORCE-SEND' ] ) ; } else { if ( isset ( $ newObject -> VEVENT -> ATTENDEE ) ) { foreach ( $ newObject -> VEVENT -> ATTENDEE as $ attendee ) { if ( $ attendee -> getNormalizedValue ( ) === $ message -> recipient ) { if ( $ message -> scheduleStatus ) { $ attendee [ 'SCHEDULE-STATUS' ] = $ message -> getScheduleStatus ( ) ; } unset ( $ attendee [ 'SCHEDULE-FORCE-SEND' ] ) ; break ; } } } } } }
This method looks at an old iCalendar object, a new iCalendar object and
starts sending scheduling messages based on the changes.

A list of addresses needs to be specified, so the system knows who made
the update, because the behavior may be different based on if it's an
attendee or an organizer.

This method may update $newObject to add any status changes.

@param VCalendar|string $oldObject
@param VCalendar        $newObject
@param array            $addresses
@param array            $ignore    any addresses to not send messages to
@param bool             $modified  a marker to indicate that the original object
modified by this process
This method looks at an old iCalendar object a new iCalendar object and starts sending scheduling messages based on the changes .