-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1654 from pbiering/set-prodid-on-collection-upload
Set prodid on collection upload
- Loading branch information
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ | |
# Copyright © 2008 Nicolas Kandel | ||
# Copyright © 2008 Pascal Halter | ||
# Copyright © 2008-2017 Guillaume Ayoub | ||
# Copyright © 2017-2018 Unrud <[email protected]> | ||
# Copyright © 2017-2020 Unrud <[email protected]> | ||
# Copyright © 2020-2023 Tuna Celik <[email protected]> | ||
# Copyright © 2024-2024 Peter Bieringer <[email protected]> | ||
# | ||
# This library is free software: you can redistribute it and/or modify | ||
|
@@ -29,14 +30,17 @@ | |
import vobject | ||
|
||
import radicale.item as radicale_item | ||
from radicale import httputils, pathutils, rights, storage, types, xmlutils | ||
from radicale import (httputils, pathutils, rights, storage, types, utils, | ||
xmlutils) | ||
from radicale.app.base import Access, ApplicationBase | ||
from radicale.hook import HookNotificationItem, HookNotificationItemTypes | ||
from radicale.log import logger | ||
|
||
MIMETYPE_TAGS: Mapping[str, str] = {value: key for key, value in | ||
xmlutils.MIMETYPES.items()} | ||
|
||
PRODID = u"-//Radicale//NONSGML Version " + utils.package_version("radicale") + "//EN" | ||
|
||
|
||
def prepare(vobject_items: List[vobject.base.Component], path: str, | ||
content_type: str, permission: bool, parent_permission: bool, | ||
|
@@ -80,6 +84,7 @@ def prepare(vobject_items: List[vobject.base.Component], path: str, | |
vobject_collection = vobject.iCalendar() | ||
for component in components: | ||
vobject_collection.add(component) | ||
vobject_collection.add(vobject.base.ContentLine("PRODID", [], PRODID)) | ||
item = radicale_item.Item(collection_path=collection_path, | ||
vobject_item=vobject_collection) | ||
item.prepare() | ||
|