- Capture previous version of event pre-overwrite for use in notification hooks
- Use previous version of event in email hooks to determine added/deleted/updated email type
This commit is contained in:
@@ -24,7 +24,7 @@ from typing import Optional
|
||||
|
||||
from radicale import httputils, storage, types, xmlutils
|
||||
from radicale.app.base import Access, ApplicationBase
|
||||
from radicale.hook import DeleteHookNotificationItem
|
||||
from radicale.hook import HookNotificationItem, HookNotificationItemTypes
|
||||
from radicale.log import logger
|
||||
|
||||
|
||||
@@ -82,10 +82,12 @@ class ApplicationPartDelete(ApplicationBase):
|
||||
return httputils.NOT_ALLOWED
|
||||
for i in item.get_all():
|
||||
hook_notification_item_list.append(
|
||||
DeleteHookNotificationItem(
|
||||
access.path,
|
||||
i.uid,
|
||||
old_content=item.serialize() # type: ignore
|
||||
HookNotificationItem(
|
||||
notification_item_type=HookNotificationItemTypes.DELETE,
|
||||
path=access.path,
|
||||
uid=i.uid,
|
||||
old_content=item.serialize(), # type: ignore
|
||||
new_content=None
|
||||
)
|
||||
)
|
||||
xml_answer = xml_delete(base_prefix, path, item)
|
||||
@@ -93,10 +95,12 @@ class ApplicationPartDelete(ApplicationBase):
|
||||
assert item.collection is not None
|
||||
assert item.href is not None
|
||||
hook_notification_item_list.append(
|
||||
DeleteHookNotificationItem(
|
||||
access.path,
|
||||
item.uid,
|
||||
old_content=item.serialize() # type: ignore
|
||||
HookNotificationItem(
|
||||
notification_item_type=HookNotificationItemTypes.DELETE,
|
||||
path=access.path,
|
||||
uid=item.uid,
|
||||
old_content=item.serialize(), # type: ignore
|
||||
new_content=None,
|
||||
)
|
||||
)
|
||||
xml_answer = xml_delete(
|
||||
|
||||
Reference in New Issue
Block a user