plugins/carddav: filter contacts with EMAIL/FN set

Don't issue a CardDAV query with any filter, Google won't return any
result.
This commit is contained in:
Simon Ser 2020-02-12 17:31:14 +01:00
parent 243e090bcb
commit 1dc00fa023
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 0 deletions

View file

@ -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 {

View file

@ -38,6 +38,9 @@ func registerRoutes(p *plugin) {
vcard.FieldUID,
},
},
PropFilters: []carddav.PropFilter{{
Name: vcard.FieldFormattedName,
}},
}
if queryText != "" {