Subject: bug#39965: [PATCH] Add support for multiple gravatar-like services

From: Robert Pluim <[email-masked]>
Date: Tue, 17 Mar 2020 14:51:22 +0100

>>>>> On Tue, 10 Mar 2020 10:31:27 +0100, Philip K. <[email-masked]> said:

    Philip> Sorry for the delay, I hope the commit message is ok now.

Sorry for my delay in getting back to you. I have one question:

    Philip> +(defun gravatar--service-libravatar (addr)
    Philip> +  "Find domain that hosts avatars for email address ADDR."
    Philip> +  ;; implements https://wiki.libravatar.org/api/
    Philip> +  (require 'dns)
    Philip> +  (let* ((domain (save-match-data
    Philip> +                   (unless (string-match ".+@\\(.+\\)" addr)
    Philip> +                     (error "%s is not an email address" addr))
    Philip> +                   (match-string 1 addr)))
    Philip> +         (result (dns-query (concat "_avatars._tcp." domain) 'SRV)))
    Philip> +    (if result
    Philip> +        (concat "http://" result "/address")
    Philip> +      "https://seccdn.libravatar.org/avatar")))

Here you do the SRV lookup for the TCP service, but I believe thereʼs
an HTTPS service type available as well. Could you look that up first,
then the TCP one, then fall back to the default libravatar URL?

Robert