aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-12 17:31:14 +0100
committerSimon Ser <contact@emersion.fr>2020-02-12 17:33:08 +0100
commit1dc00fa023257696b57bd1cbc70601d96492eea3 (patch)
tree9f30260ee0f39063af6cf16c6c60f5f0d13673d5 /plugins
parent243e090bcb31892120d1012c8f5a1500a8ac63f8 (diff)
downloadalps-1dc00fa023257696b57bd1cbc70601d96492eea3.tar.gz
alps-1dc00fa023257696b57bd1cbc70601d96492eea3.zip
plugins/carddav: filter contacts with EMAIL/FN set
Don't issue a CardDAV query with any filter, Google won't return any result.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/carddav/plugin.go3
-rw-r--r--plugins/carddav/routes.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/plugins/carddav/plugin.go b/plugins/carddav/plugin.go
index a77762b..947a754 100644
--- a/plugins/carddav/plugin.go
+++ b/plugins/carddav/plugin.go
@@ -121,6 +121,9 @@ func newPlugin(srv *koushin.Server) (koushin.Plugin, error) {
DataRequest: carddav.AddressDataRequest{
Props: []string{vcard.FieldFormattedName, vcard.FieldEmail},
},
+ PropFilters: []carddav.PropFilter{{
+ Name: vcard.FieldEmail,
+ }},
}
addrs, err := c.QueryAddressBook(addressBook.Path, &query)
if err != nil {
diff --git a/plugins/carddav/routes.go b/plugins/carddav/routes.go
index 2f33852..45a6237 100644
--- a/plugins/carddav/routes.go
+++ b/plugins/carddav/routes.go
@@ -38,6 +38,9 @@ func registerRoutes(p *plugin) {
vcard.FieldUID,
},
},
+ PropFilters: []carddav.PropFilter{{
+ Name: vcard.FieldFormattedName,
+ }},
}
if queryText != "" {