view/html: issue-page: Filter empty messages for all users.
authorRicardo Wurmus <rekado@elephly.net>
Wed, 13 May 2020 10:09:28 +0000 (12:09 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Wed, 13 May 2020 10:09:28 +0000 (12:09 +0200)
mumi/web/view/html.scm

index a8dcde2dbe496ea5b4a7fd00c910b2189bd6a76b..c297366208f0deb8244caa6a8191f433fd1b3d97 100644 (file)
@@ -319,7 +319,13 @@ failed to process associated messages.")
 (define* (issue-page bug #:optional flash-message)
   "Render the conversation for the given BUG."
   (define id (bug-num bug))
-  (define messages (issue-messages id))
+  (define messages
+    (filter (lambda (msg)
+              ;; Ignore messages without body, and internal messages.
+              (and msg
+                   (email-body msg)
+                   (not (internal-message? msg))))
+            (issue-messages id)))
   (define parties (sort (filter (compose (negate bot?) extract-email)
                                 (participants (filter identity messages)))
                         (lambda (a b)
@@ -574,19 +580,11 @@ currently disabled."))
           (div (@ (class "row"))
                (div
                 (@ (class "conversation col-12"))
-                ,(let ((msgs (filter (lambda (msg)
-                                       ;; Ignore messages
-                                       ;; without body, and
-                                       ;; internal messages.
-                                       (and msg
-                                            (email-body msg)
-                                            (not (internal-message? msg))))
-                                     messages)))
-                   (map show-message
-                        (iota (length msgs))
-                        msgs
-                        (cons (bug-subject* bug)
-                              (map subject msgs))))
+                ,(map show-message
+                      (iota (length messages))
+                      messages
+                      (cons (bug-subject* bug)
+                            (map subject messages)))
                 ,comment-box)))))))
 
 (define (list-of-bugs bugs)