diff options
author | Chris Rebert <code@rebertia.com> | 2015-04-14 06:02:58 +0300 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2015-04-14 06:02:58 +0300 |
commit | 015c219fef20b7bc941d8fa2981d1a39732ae7a4 (patch) | |
tree | 61779c61ab1baf4aa53c4ad592ea2be0c1f8b969 /src | |
parent | ac9f74afe1d1d58b1fb42cf7050e6ca56820ea8e (diff) |
An issue's description doesn't count as a comment
Diffstat (limited to 'src')
-rw-r--r-- | src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala b/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala index 0d980fd..13a87aa 100644 --- a/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala +++ b/src/main/scala/com/getbootstrap/no_carrier/github/FancyIssue.scala @@ -8,9 +8,12 @@ import InstantOrdering._ class FancyIssue(val issue: Issue, val label: String, val timeout: Duration)(implicit clock: Clock) { lazy val lastLabelledAt: Instant = issue.lastLabelledWithAt(label).get - lazy val lastCommentedOnAt: Instant = issue.smartComments.map{ _.createdAt.toInstant }.max + lazy val lastCommentedOnAt: Option[Instant] = issue.smartComments.map{ _.createdAt.toInstant }.maxOption lazy val lastClosedAt: Option[Instant] = issue.smartEvents.filter{ _.isClosed }.map{ _.createdAt.toInstant }.maxOption - lazy val hasSubsequentComment: Boolean = lastLabelledAt < lastCommentedOnAt + lazy val hasSubsequentComment: Boolean = lastCommentedOnAt match { + case None => false + case Some(commentedAt) => lastLabelledAt < commentedAt + } lazy val wasClosedAfterLabelling: Boolean = lastClosedAt match { case None => false case Some(closedAt) => lastLabelledAt < closedAt |