Fix Libravatar federation handling

* lisp/image/gravatar.el (gravatar--service-libravatar): Implement
correct algorithm (bug#40354).
This commit is contained in:
Philip K 2020-08-18 21:19:21 +02:00 committed by Lars Ingebrigtsen
parent ea0e09cf2c
commit f45e79233c

View file

@ -151,10 +151,11 @@ to track whether you're reading a specific mail."
(save-match-data
(if (not (string-match ".+@\\(.+\\)" addr))
(funcall callback "https://seccdn.libravatar.org/avatar")
(let* ((domain (match-string 1 addr))
(records '(("_avatars-sec" . "https")
("_avatars" . "http")))
(func
(let ((domain (match-string 1 addr))
(records '(("_avatars-sec" . "https")
("_avatars" . "http")))
func)
(setq func
(lambda (result)
(cond
((and
@ -205,7 +206,7 @@ to track whether you're reading a specific mail."
(concat (caar records) "._tcp." domain)
func 'SRV))
(t ;fallback
(funcall callback "https://seccdn.libravatar.org/avatar"))))))
(funcall callback "https://seccdn.libravatar.org/avatar")))))
(dns-query-asynchronous
(concat (caar records) "._tcp." domain)
func 'SRV t)))))