nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
564 stars 169 forks source link

Libravatar Support for Social Media Lookup #2405

Open jgdye opened 3 years ago

jgdye commented 3 years ago

Libravatar (https://www.libravatar.org/) is an open-source federated avatar service that can act as a Gravatar replacement for users, and be self-hosted by domain owners, who can publish the location for their server in SRV DNS entries. It gracefully falls back to Gravatar if the e-mail address is not found through their service. It would be nice to be able to use this as opposed to Gravatar.

The documentation for the API is located at https://wiki.libravatar.org/api/, but it essentially boils down to doing a lookup for the email domain SRV record and replacing www.gravatar.com with the appropriate base directory, using http://cdn.libravatar.org/avatar or https://secdn.libravatar.org/avatar. As an initial implementation for apps already supporting Gravatar, they recommend just doing this replacement without doing the lookup. Since Libravatar falls back to Gravatar (and handles the federated lookup whether using the main site or self hosted), it would be reasonable to simply allow the site admin to set the "Gravatar" address to quickly implement this functionality.

call-me-matt commented 3 years ago

Maybe @eleith can take a look, as he implemented the gravatar feature.

eleith commented 3 years ago

the implementation requires some intermediate steps (grab the domain and do a DNS lookup to see if the domain supports avatar lookup, and if it does, pull the image else use gravatar).

there is a php library that implements these steps: https://wiki.libravatar.org/libraries/#index8h2

what is the process for getting approval if such a library could be pulled into this project?