2011-01-26 02:17:19 +01:00
|
|
|
<?php
|
|
|
|
|
2012-03-13 19:18:11 +01:00
|
|
|
final class DifferentialNewDiffMail extends DifferentialReviewRequestMail {
|
2011-01-26 02:17:19 +01:00
|
|
|
|
2012-06-11 21:21:37 +02:00
|
|
|
protected function renderVaryPrefix() {
|
2011-01-26 02:17:19 +01:00
|
|
|
$revision = $this->getRevision();
|
|
|
|
$line_count = $revision->getLineCount();
|
2012-06-14 22:43:09 +02:00
|
|
|
$lines = pht('%d line(s)', $line_count);
|
2011-01-26 02:17:19 +01:00
|
|
|
|
|
|
|
if ($this->isFirstMailToRecipients()) {
|
|
|
|
$verb = 'Request';
|
|
|
|
} else {
|
|
|
|
$verb = 'Updated';
|
|
|
|
}
|
|
|
|
|
2012-06-11 21:21:37 +02:00
|
|
|
return "[{$verb}, {$lines}]";
|
2011-01-26 02:17:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function renderBody() {
|
|
|
|
$actor = $this->getActorName();
|
|
|
|
|
|
|
|
$name = $this->getRevision()->getTitle();
|
|
|
|
|
|
|
|
$body = array();
|
|
|
|
|
|
|
|
if ($this->isFirstMailToRecipients()) {
|
|
|
|
$body[] = "{$actor} requested code review of \"{$name}\".";
|
|
|
|
} else {
|
|
|
|
$body[] = "{$actor} updated the revision \"{$name}\".";
|
|
|
|
}
|
2012-06-08 08:59:31 +02:00
|
|
|
$body[] = null;
|
2011-01-26 02:17:19 +01:00
|
|
|
|
|
|
|
$body[] = $this->renderReviewRequestBody();
|
|
|
|
|
|
|
|
return implode("\n", $body);
|
|
|
|
}
|
|
|
|
}
|