[Pkg-owncloud-commits] [php-sabredav] 145/275: Support for email-address-set.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:56:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit 0de0540b407a93d1b2e2e16842a72381c42be5a9
Author: Evert Pot <me at evertpot.com>
Date:   Mon Aug 11 18:14:31 2014 -0400

    Support for email-address-set.
---
 lib/CalDAV/Plugin.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/CalDAV/Plugin.php b/lib/CalDAV/Plugin.php
index 7342085..1c84cd3 100644
--- a/lib/CalDAV/Plugin.php
+++ b/lib/CalDAV/Plugin.php
@@ -320,6 +320,18 @@ class Plugin extends DAV\ServerPlugin {
                 $addresses[] = $this->server->getBaseUri() . $node->getPrincipalUrl() . '/';
                 return new HrefList($addresses, false);
             });
+            // For some reason somebody thought it was a good idea to add
+            // another one of these properties. We're supporting it too.
+            $propFind->handle('{' . self::NS_CALENDARSERVER . '}email-address-set', function() use ($node) {
+                $addresses = $node->getAlternateUriSet();
+                $emails = [];
+                foreach($addresses as $address) {
+                    if (substr($address,0,7)==='mailto:') {
+                        $emails[] = $address;
+                    }
+                }
+                return new HrefList($emails, false);
+            });
 
             // These two properties are shortcuts for ical to easily find
             // other principals this principal has access to.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list