Subject: bug#70871: closed (Re: bug#70871: [PATCH v2 0/2] Show avatars from Libavatar.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 12 Feb 2025 02:32:02 +0000

Your bug report

#70871: [PATCH] Show avatars from Libravatar.

which was filed against the mumi package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70871: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70871
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70871: [PATCH v2 0/2] Show avatars from Libavatar.
From: Arun Isaac <[email-masked]>
To: [email-masked], [email-masked]
Cc: Noé Lopez <[email-masked]>
Date: Wed, 12 Feb 2025 02:31:12 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Noé,

Sorry for the long wait! I have pushed the patches with a few
modifications. Most significantly, I am defaulting to an identicon
instead of a 404. That way, we don't have to use the alt text as a
makeshift avatar. And, we get unique identicon avatars even if the first
letter of two people's names is the same.

With this patchset, we are now dependent on an external service for our
avatars. We should probably cache these avatars. But for now, maybe we
can just hope that the external service holds up! And, we should ideally
implement DNS lookups in guile-avatar to support federation. That's a
little project if you're up for it. ;-) Maybe the guile-dns library is
useful in this regard.

I'll redeploy the mumi instance on issues.guix.gnu.org in a day or so.

Thank you for your patience!
Arun

Subject: [PATCH] Show avatars from Libravatar.
From: Felix Lechner <[email-masked]>
To: [email-masked]
Cc: Felix Lechner <[email-masked]>
Date: Fri, 10 May 2024 20:20:08 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Requires guile-avatar from here:

    https://codeberg.org/lechner/guile-avatar

The packaging code for guile-avatar can be added to Guix by accepting
this patch:

    https://debbugs.gnu.org/70870

In Guix, the package should then be mentioned as an "input" to mumi,
together with an updated commit hash or version for mumi.

A live preview of this change is available at:

    https://patchwise.org/38809
---
 mumi/web/view/html.scm | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm
index 2275799..bd5caec 100644
--- a/mumi/web/view/html.scm
+++ b/mumi/web/view/html.scm
@@ -19,6 +19,7 @@
 ;;; <http://www.gnu.org/licenses/>.
 
 (define-module (mumi web view html)
+  #:use-module (avatar url)
   #:use-module (email email)
   #:use-module (mumi config)
   #:use-module (mumi debbugs)
@@ -451,12 +452,12 @@ failed to process associated messages.")
          ,(map (match-lambda
                  ((message-number message)
                   `(li
-                    (div
-                     (@ (class "avatar")
-                        (style ,(string-append "background-color:"
-                                               (avatar-color (sender-email message)
-                                                             (map extract-email parties)))))
-                     ,(string-upcase (string-take (sender-name message) 1)))
+                    (img (@ (class "avatar")
+                            (style ,(string-append "background-color:"
+                                                   (avatar-color (sender-email message)
+                                                                 (map extract-email parties))))
+                            (src ,(libravatar-url (sender-email message) #:default "404"))
+                            (alt ,(string-upcase (string-take (sender-name message) 1)))))
                     (span (@ (class "date"))
                           (a (@ (href ,(string-append "#" (number->string
                                                            message-number))))
@@ -621,12 +622,12 @@ currently disabled."))
              (id ,(number->string message-number))))
        (a (@ (class "message-anchor")
              (id ,(format #false "msgid-~a" (msgid-hash (message-id message))))))
-       (div
-        (@ (class "avatar")
-           (style ,(string-append "background-color:"
-                                  (avatar-color (sender-email message)
-                                                (map extract-email parties)))))
-        ,(string-upcase (string-take (sender-name message) 1)))
+       (img (@ (class "avatar")
+               (style ,(string-append "background-color:"
+                                      (avatar-color (sender-email message)
+                                                    (map extract-email parties))))
+               (src ,(libravatar-url (sender-email message) #:default "404"))
+               (alt ,(string-upcase (string-take (sender-name message) 1)))))
        (article
         (@ (class "message"))
         (header

base-commit: 394c90d4a176756b9f0f4a716a2646ab98d8f167
-- 
2.41.0