handle addressbook-multiget like calendar-multiget
authorPetter Reinholdtsen <pere@hungry.com>
Wed, 27 Jan 2016 19:29:15 +0000 (20:29 +0100)
committerJelmer Vernooij <jelmer@jelmer.uk>
Wed, 27 Jan 2016 21:46:24 +0000 (21:46 +0000)
I had a closer look at another of the changes from chrysn, and it seem
to be OK to me.  I've checked both RFC 4791 and 6352, and verified that
the two requirements for *-multiget are equivalent for CalDAV and
CardDAV.  I thus believe this patch should be applied.

From 886f7bc0ef0cb74f4cae5d757708146c85fc5185 Mon Sep 17 00:00:00 2001
From: chrysn <chrysn@fsfe.org>
Date: Tue, 28 Oct 2014 16:08:13 +0100
Subject: [PATCH] handle addressbook-multiget like calendar-multiget

the requests are analogous, and without that handling, calypso would
report the complete set instead of only the selected entries.

this was brought to light by duplicate entries in davdroid, which should
check the urls by itself, but things are easier to fix here.

calypso/xmlutils.py

index 67290b7b1e61f1e8fd0b1068c237f2c82203e464..e3a65bb0aa9af738577a566476f65345400ec97c 100644 (file)
@@ -331,7 +331,7 @@ def report(path, xml_request, collection):
     filter_element = root.find(_tag("C", "filter"))
 
     if collection:
-        if root.tag == _tag("C", "calendar-multiget"):
+        if root.tag == _tag("C", "calendar-multiget") or root.tag == _tag('A', 'addressbook-multiget'):
             # Read rfc4791-7.9 for info
             hreferences = set((href_element.text for href_element
                                in root.findall(_tag("D", "href"))))