Skip to content

Commit

Permalink
Add RADICALE:displayname property for raw displayname
Browse files Browse the repository at this point in the history
Remove workaround from the web interface.
  • Loading branch information
Unrud committed Sep 17, 2017
1 parent 2c06690 commit d9aafd1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 6 additions & 6 deletions radicale/web/fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,6 @@ function get_collections(user, password, collection, callback) {
description = calendardesc_element ? calendardesc_element.textContent : "";
}
}
// Quirks
if (href === (displayname ? "/" + displayname + "/" : "/")) {
displayname = "";
}
var sane_color = color.trim();
if (sane_color) {
var color_match = COLOR_RE.exec(sane_color);
Expand All @@ -249,10 +245,14 @@ function get_collections(user, password, collection, callback) {
}
};
request.send('<?xml version="1.0" encoding="utf-8" ?>' +
'<propfind xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:CR="urn:ietf:params:xml:ns:carddav" xmlns:I="http://apple.com/ns/ical/" xmlns:INF="http://inf-it.com/ns/ab/">' +
'<propfind xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" ' +
'xmlns:CR="urn:ietf:params:xml:ns:carddav" ' +
'xmlns:I="http://apple.com/ns/ical/" ' +
'xmlns:INF="http://inf-it.com/ns/ab/" ' +
'xmlns:RADICALE="http://radicale.org/ns/">' +
'<prop>' +
'<resourcetype />' +
'<displayname />' +
'<RADICALE:displayname />' +
'<I:calendar-color />' +
'<INF:addressbook-color />' +
'<C:calendar-description />' +
Expand Down
10 changes: 9 additions & 1 deletion radicale/xmlutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"D": "DAV:",
"CS": "http://calendarserver.org/ns/",
"ICAL": "http://apple.com/ns/ical/",
"ME": "http://me.com/_namespace/"}
"ME": "http://me.com/_namespace/",
"RADICALE": "http://radicale.org/ns/"}

NAMESPACES_REV = {}
for short, url in NAMESPACES.items():
Expand Down Expand Up @@ -986,6 +987,13 @@ def _propfind_response(base_prefix, path, item, props, user, write=False,
tag = ET.Element(_tag("D", "href"))
tag.text = _href(base_prefix, "/%s/" % collection.owner)
element.append(tag)
elif tag == _tag("RADICALE", "displayname"):
# Only for internal use by the web interface
displayname = item.get_meta("D:displayname")
if is_leaf and displayname is not None:
element.text = displayname
else:
is404 = True
elif tag == _tag("D", "displayname"):
if is_leaf:
element.text = item.get_meta("D:displayname") or item.path
Expand Down

0 comments on commit d9aafd1

Please sign in to comment.