From 1dc00fa023257696b57bd1cbc70601d96492eea3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Feb 2020 17:31:14 +0100 Subject: plugins/carddav: filter contacts with EMAIL/FN set Don't issue a CardDAV query with any filter, Google won't return any result. --- plugins/carddav/plugin.go | 3 +++ plugins/carddav/routes.go | 3 +++ 2 files changed, 6 insertions(+) (limited to 'plugins') 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 != "" { -- cgit v1.2.3