diff --git a/radicale/calendar.py b/radicale/calendar.py index 0b1c0f9..220af1f 100644 --- a/radicale/calendar.py +++ b/radicale/calendar.py @@ -60,6 +60,10 @@ class Calendar(object): """Return unicode calendar from the calendar.""" return unicode(support.read(self.cal), self.encoding) + def etag(self): + """Return etag from calendar.""" + return hash_tag(self.vcalendar()) + class Event(object): """Internal event class.""" def __init__(self, vcalendar): diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index a21055a..8e265ff 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -105,6 +105,16 @@ def propfind(xml_request, calendar, url): owner.text = calendar.owner prop.append(owner) + if _tag("D", "getcontenttype") in properties: + getcontenttype = ET.Element(_tag("D", "getcontenttype")) + getcontenttype.text = "text/calendar" + prop.append(getcontenttype) + + if _tag("D", "getetag") in properties: + getetag = ET.Element(_tag("D", "getetag")) + getetag.text = calendar.etag() + prop.append(getetag) + if _tag("CS", "getctag") in properties: getctag = ET.Element(_tag("CS", "getctag")) getctag.text = calendar.ctag