]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1262462 - automatically collapse the first comment when it's empty
authorDylan Hardison <dylan@mozilla.com>
Fri, 20 May 2016 20:31:46 +0000 (16:31 -0400)
committerDylan Hardison <dylan@mozilla.com>
Fri, 20 May 2016 20:34:35 +0000 (16:34 -0400)
extensions/BugModal/lib/ActivityStream.pm

index 86fa6bb3b706f1f743acc2ceaae6f6869a4f04a2..b3b8bbaa6d5095916fa7f098b9c432235539be8b 100644 (file)
@@ -174,6 +174,10 @@ sub _add_comments_to_stream {
             $comment->{collapsed} = 1;
             $comment->{collapsed_reason} = $comment->author->name;
         }
+        if ($comment->type != CMT_ATTACHMENT_CREATED && $comment->count == 0 && length($comment->body) == 0) {
+            $comment->{collapsed} = 1;
+            $comment->{collapsed_reason} = 'empty';
+        }
 
         _add_comment_to_stream($stream, date_str_to_time($comment->creation_ts), $comment->author->id, $comment);
     }