view: Show changed message subjects.
authorRicardo Wurmus <rekado@elephly.net>
Thu, 20 Sep 2018 13:46:49 +0000 (15:46 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Thu, 20 Sep 2018 17:17:15 +0000 (19:17 +0200)
Suggested-by: Ludovic Court├Ęs <ludo@gnu.org>
mumi/web/view/html.scm

index 5977161..a0431e8 100644 (file)
@@ -256,7 +256,7 @@ range.  The supported arguments are the same as for "
                         (lambda (a b)
                           (string< (extract-email a)
                                    (extract-email b)))))
-  (define (show-message message)
+  (define (show-message message previous-subject)
     `((div
        (@ (class "row"))
        (a (@ (id ,(number->string (email-msg-num message)))))
@@ -280,6 +280,9 @@ range.  The supported arguments are the same as for "
                  (a (@ (href ,(string-append "#" (number->string
                                                   (email-msg-num message)))))
                     ,(date message))))
+          ,@(if (string-suffix? previous-subject (subject message))
+                '()
+                `((div (@ (class "subject")) ,(subject message))))
           (div
            (@ (class "details"))
            (div
@@ -334,13 +337,18 @@ range.  The supported arguments are the same as for "
        (@ (class "row"))
        (div
         (@ (class "conversation col-md-9"))
-        ,(map show-message (filter (lambda (msg)
-                                     ;; Ignore messages
-                                     ;; without body, and
-                                     ;; internal messages.
-                                     (and (email-body msg)
-                                          (not (internal-message? msg))))
-                                   messages))
+        ,(let ((msgs (filter (lambda (msg)
+                               ;; Ignore messages
+                               ;; without body, and
+                               ;; internal messages.
+                               (and (email-body msg)
+                                    (not (internal-message? msg))))
+                             messages)))
+           (map (lambda (msg previous-subject)
+                  (show-message msg previous-subject))
+                msgs
+                (cons (bug-subject bug)
+                      (map subject msgs))))
         (div
          (@ (class "row comment-box"))
          (a (@ (id "comment")))