Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
NotificationMail: Fix incorrect References header
Browse files Browse the repository at this point in the history
A message id of a notification mail for new comment thread should be the
message id of the comment thread's first comment.
  • Loading branch information
Yi EungJun committed Jan 27, 2015
1 parent 157cefe commit 6299412
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/models/NotificationMail.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,18 @@ public void addReferences() {
Resource container = resource.getContainer();

if (container != null) {
addHeader("References", container.getMessageId());
String reference;
switch (container.getType()) {
case COMMENT_THREAD:
CommentThread thread =
CommentThread.find.byId(Long.valueOf(container.getId()));
reference = thread.getFirstReviewComment().asResource().getMessageId();
break;
default:
reference = container.getMessageId();
break;
}
addHeader("References", reference);
}
}
}
Expand Down

0 comments on commit 6299412

Please sign in to comment.