mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
- Compare previous-current events to determine if non-invitee changes were made (notify non-added/removed attendees of event update)
This commit is contained in:
parent
3dbe68705b
commit
d541719c4c
2 changed files with 71 additions and 16 deletions
|
@ -55,16 +55,17 @@ def _cleanup(path):
|
|||
|
||||
class HookNotificationItem:
|
||||
|
||||
def __init__(self, notification_item_type, path, uid=None, new_content=None, old_content=None):
|
||||
def __init__(self, notification_item_type, path, content=None, uid=None, new_content=None, old_content=None):
|
||||
self.type = notification_item_type.value
|
||||
self.point = _cleanup(path)
|
||||
self._content_legacy = content
|
||||
self.uid = uid
|
||||
self.new_content = new_content
|
||||
self.old_content = old_content
|
||||
|
||||
@property
|
||||
def content(self): # For backward compatibility
|
||||
return self.uid or self.new_content or self.old_content
|
||||
return self._content_legacy or self.uid or self.new_content or self.old_content
|
||||
|
||||
@property
|
||||
def replaces_existing_item(self) -> bool:
|
||||
|
@ -73,8 +74,7 @@ class HookNotificationItem:
|
|||
|
||||
def to_json(self):
|
||||
return json.dumps(
|
||||
self,
|
||||
default=lambda o: o.__dict__,
|
||||
{**self.__dict__, "content": self.content},
|
||||
sort_keys=True,
|
||||
indent=4
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue