1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Fix two edge case issues with Differential mail tags

Summary:
Via Asana. The tags on Differential mail are wrong in two cases:

  - Transactions which submit inline comments but no comment text are not labeled as "comments", but should be.
  - Non-close, non-comment transactions are not labeled at all, but should be labeled "other".

Test Plan: Submitted a no-comments, inlines-only transaction and got a message with proper `X-Phabricator-Mail-Tags` header.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7912
This commit is contained in:
epriestley 2014-01-09 10:56:27 -08:00
parent b960c8114b
commit 68de639470

View file

@ -56,7 +56,10 @@ final class DifferentialCommentMail extends DifferentialMail {
break;
}
if (strlen(trim($comment->getContent()))) {
$has_comment = strlen(trim($comment->getContent()));
$has_inlines = (bool)$this->getInlineComments();
if ($has_comment || $has_inlines) {
switch ($action) {
case DifferentialAction::ACTION_CLOSE:
// Commit comments are auto-generated and not especially interesting,
@ -68,6 +71,10 @@ final class DifferentialCommentMail extends DifferentialMail {
}
}
if (!$tags) {
$tags[] = MetaMTANotificationType::TYPE_DIFFERENTIAL_OTHER;
}
return $tags;
}