diff options
Diffstat (limited to 'lisp/image')
-rw-r--r-- | lisp/image/gravatar.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el index 4f37834a27f..f6f056a2baf 100644 --- a/lisp/image/gravatar.el +++ b/lisp/image/gravatar.el @@ -160,16 +160,19 @@ to track whether you're reading a specific mail." (cond ((and result ;there is a result - (let* ((data (mapcar (lambda (record) + (let* ((answers (dns-get 'answers result)) + (data (mapcar (lambda (record) (dns-get 'data (cdr record))) - (dns-get 'answers result))) + ;; We may get junk data back (or CNAME; + ;; ignore). + (and (eq (dns-get 'type answers) 'SRV) + answers))) (priorities (mapcar (lambda (r) (dns-get 'priority r)) data)) - (max-priority (if priorities - (apply #'max priorities) - 0)) - (sum 0) top) + (max-priority (apply #'max 0 priorities)) + (sum 0) + top) ;; Attempt to find all records with the same maximal ;; priority, and calculate the sum of their weights. (dolist (ent data) |