Skip to content

fix(caldav-delegation): send notification to delegator#60712

Open
hamza221 wants to merge 1 commit into
masterfrom
fix/caldav-delegation/notifications
Open

fix(caldav-delegation): send notification to delegator#60712
hamza221 wants to merge 1 commit into
masterfrom
fix/caldav-delegation/notifications

Conversation

@hamza221
Copy link
Copy Markdown
Contributor

@hamza221 hamza221 commented May 24, 2026

Summary

Sends notifications to delegator for actions taken on his behalf by delegate

Create update move/delete restore permenant deletion
image image image image image

Testing

Should work out of the box but :
If you need the frontend checkout

If you need trashbin:

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@hamza221 hamza221 added 2. developing Work in progress feature: caldav Related to CalDAV internals enhancement labels May 24, 2026
@hamza221 hamza221 modified the milestones: Nextcloud 34, Nextcloud 35 May 24, 2026
@hamza221
Copy link
Copy Markdown
Contributor Author

/backport to stable34

@hamza221
Copy link
Copy Markdown
Contributor Author

/backport to stable33

@hamza221
Copy link
Copy Markdown
Contributor Author

/backport to stable32

@hamza221 hamza221 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 24, 2026
@hamza221 hamza221 marked this pull request as ready for review May 24, 2026 13:07
@hamza221 hamza221 requested review from ArtificialOwl, CarlSchwan, leftybournes and provokateurin and removed request for a team May 24, 2026 13:08
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the fix/caldav-delegation/notifications branch from a2d4fe7 to d9aec9b Compare May 24, 2026 13:11
@hamza221 hamza221 self-assigned this May 24, 2026
Copy link
Copy Markdown
Contributor

@SebastianKrupinski SebastianKrupinski May 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

If I am reading this correctly, you are using a global context class to transport data from the plugin to the event listener. This is a bad idea, in my opinion.

Also this plugin is only really needed in one instance on update, that is wasteful and the calendar object update event already emits the new data:

CalendarObjectUpdatedEvent

What you do need is the CalendarObjectUpdatedEvent to also carry previous data, I would extend the event to also emit the previous object data also. It is only emitted in one place so you are save to change it.

I would recommend changing the updateCalendarObject method to first pull the existing record, then updated it and then use can use the array for both new and previous, just replace record in the array with the new data from $extraData

public function updateCalendarObject($calendarId, $objectUri, $calendarData, $calendarType = self::CALENDAR_TYPE_CALENDAR) {

return;
}

$oldVCalendar = $this->delegateActionContext->getPrevious();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments above

Copy link
Copy Markdown
Contributor

@GVodyanov GVodyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The designs look really nice, but do you need a mail server to test this? I can't get it to work but I think that's just my instance being buggy

@hamza221
Copy link
Copy Markdown
Contributor Author

hamza221 commented May 25, 2026

The designs look really nice, but do you need a mail server to test this? I can't get it to work but I think that's just my instance being buggy

The delegator needs to have an email address setup in his profile (so he can receive an email)

If you're using https://github.com/juliusknorr/nextcloud-docker-dev/ , just go to mail.local to see the messages,
If not you have to setup an actual mail server and email addresses that you have access to

Copy link
Copy Markdown
Contributor

@GVodyanov GVodyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works and looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews backport-request enhancement feature: caldav Related to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants