carddav: add AddressObject.Remove
This commit is contained in:
parent
e8ff91c542
commit
38f6f04e75
|
@ -170,6 +170,18 @@ func (ao *addressObject) SetCard(card vcard.Card) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ao *addressObject) Remove() error {
|
||||||
|
resps, err := ao.ab.c.DeleteContacts([]string{ao.contact.ID})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if len(resps) != 1 {
|
||||||
|
return errors.New("hydroxide/carddav: expected exactly one response when deleting contact")
|
||||||
|
}
|
||||||
|
resp := resps[0]
|
||||||
|
return resp.Err()
|
||||||
|
}
|
||||||
|
|
||||||
type addressBook struct {
|
type addressBook struct {
|
||||||
c *protonmail.Client
|
c *protonmail.Client
|
||||||
cache map[string]*addressObject
|
cache map[string]*addressObject
|
||||||
|
|
Loading…
Reference in New Issue