phorge/src/applications/differential/mail/DifferentialNewDiffMail.php0acb7734cdbdmaster
phorge/src/applications/differential/mail/DifferentialNewDiffMail.php
0acb7734cdbdmaster
DifferentialNewDiffMail.php
DifferentialNewDiffMail.php
de1fb8ac7de7 | <?php | ||
---|---|---|---|
/* | |||
11cccb98c2be | * Copyright 2012 Facebook, Inc. | ||
de1fb8ac7de7 | * | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
11cccb98c2be | final class DifferentialNewDiffMail extends DifferentialReviewRequestMail { | ||
de1fb8ac7de7 | |||
2793828795d7 | protected function renderVaryPrefix() { | ||
de1fb8ac7de7 | $revision = $this->getRevision(); | ||
$line_count = $revision->getLineCount(); | |||
0acb7734cdbd | $lines = pht('%d line(s)', $line_count); | ||
de1fb8ac7de7 | |||
if ($this->isFirstMailToRecipients()) { | |||
$verb = 'Request'; | |||
} else { | |||
$verb = 'Updated'; | |||
} | |||
2793828795d7 | return "[{$verb}, {$lines}]"; | ||
de1fb8ac7de7 | } | ||
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}\"."; | |||
} | |||
692296a4d414 | $body[] = null; | ||
de1fb8ac7de7 | |||
$body[] = $this->renderReviewRequestBody(); | |||
return implode("\n", $body); | |||
} | |||
} |
Owner Packages
Owner Packages
- No Owners