GNU bug report logs -
#70871
[PATCH] Show avatars from Libravatar.
Previous Next
Full log
View this message in rfc822 format
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
This bug report was last modified 92 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.