signalapp / Flock

Private contact and calendar sync for Android.
https://signal.org/blog/flock
358 stars 80 forks source link

Q: Will contact groups functionality be added in future? #41

Open cyanfr opened 10 years ago

cyanfr commented 10 years ago

Q: Will contact groups functionality be added in future?

rhodey commented 10 years ago

Yes. A few months ago I did some preliminary reading on contacts groups and multiple sources said that it was impossible for anyone but Google to support contact groups due to hard coded restrictions in the Android OS. I haven't done research since then but these same sources turned out to be wrong about a few other things, so I'm pretty sure it must be possible.

Labelling as feature request, will get to it.

rhodey commented 10 years ago

Just checking in to provide some updates on this feature request...

I had to dig into Android contact groups in order to resolve #54 and in doing so found nothing serious blocking contact group support in Flock. The only reason I've yet to implement this feature is that I haven't come up with a "clean" way to map contacts to groups in the world of CardDAV.

I think the best way to map contacts to contact groups is to have one separate address book per each group and have this address book contain only contacts within its group. The problem with this approach is that the servers running the Flock Sync service don't currently support multiple address books per user.

Some other ideas:

  1. Create a new group "VCard property" to be set on each contact, so each contact object would contain the name of all its groups. One issue with this is that a change to group name would require a change in all contacts within that group meaning wasted bandwidth.
  2. Create the new group property but have it reference a permanent group ID instead of name, this would allow group name to change without requiring a change to all the contacts it contains.

Support for multiple address books is a missing feature in many WebDAV servers and because of this I kind of prefer the group id property idea. The thing left to figure out is where in WebDAV or CardDAV should the mapping of group ids to group names be maintained?

rhodey commented 10 years ago

happy update :D

I'm not sure how I glazed over this before but the vCard RFC actually specifies exactly how contact groups should be implemented within vCard, check out section 6.1.4

vCards with the KIND property set to group are expected to represent groups, members of the group are recorded within the group vCard by use of the MEMBER property. The value of a MEMBER property must be a URI and it makes sense the most sense to me for this URI to contain the UUID property of the member contact, eg: urn:uuid:<member contact uuid>

Hoping to move forward with this soon, Flock will probably be patched to copy over group information on import of contacts but we will also need to create a new UI for managing of contact groupings-- that might be difficult to make usable.

cyanfr commented 10 years ago

Oooo! Nice! Thanks for the update.