summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2016-05-20 22:31:46 +0200
committerDylan Hardison <dylan@mozilla.com>2016-05-20 22:34:35 +0200
commit8fda28c4c50530f9e04699874046df2eb459d40d (patch)
tree1ffaeb7863ee5224fb79e825cafa3a472e228bb1 /extensions
parentd7db0c1d84c999b470d8f2c4ce870a012a4ce165 (diff)
downloadbugzilla-8fda28c4c50530f9e04699874046df2eb459d40d.tar.gz
bugzilla-8fda28c4c50530f9e04699874046df2eb459d40d.tar.xz
Bug 1262462 - automatically collapse the first comment when it's empty
Diffstat (limited to 'extensions')
-rw-r--r--extensions/BugModal/lib/ActivityStream.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/extensions/BugModal/lib/ActivityStream.pm b/extensions/BugModal/lib/ActivityStream.pm
index 86fa6bb3b..b3b8bbaa6 100644
--- a/extensions/BugModal/lib/ActivityStream.pm
+++ b/extensions/BugModal/lib/ActivityStream.pm
@@ -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);
}