1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 12:30:56 +01:00

Add mailtags to Ponder

Summary: Ref T3578  Adds mailtags to Ponder, answer stuff not quite ready, but that's another diff.

Test Plan: set preferences to notify, second account updates a question, get notification on first.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3578

Differential Revision: https://secure.phabricator.com/D13886
This commit is contained in:
Chad Little 2015-08-13 13:00:47 -07:00
parent 8c06d89070
commit 3db9e4b4e5
2 changed files with 40 additions and 0 deletions

View file

@ -212,6 +212,19 @@ final class PonderQuestionEditor
return true; return true;
} }
public function getMailTagsMap() {
return array(
PonderQuestionTransaction::MAILTAG_DETAILS =>
pht('Someone changes the questions details.'),
PonderQuestionTransaction::MAILTAG_ANSWERS =>
pht('Someone adds a new answer.'),
PonderQuestionTransaction::MAILTAG_COMMENT =>
pht('Someone comments on the question.'),
PonderQuestionTransaction::MAILTAG_OTHER =>
pht('Other question activity not listed above occurs.'),
);
}
protected function buildReplyHandler(PhabricatorLiskDAO $object) { protected function buildReplyHandler(PhabricatorLiskDAO $object) {
return id(new PonderQuestionReplyHandler()) return id(new PonderQuestionReplyHandler())
->setMailReceiver($object); ->setMailReceiver($object);

View file

@ -8,6 +8,11 @@ final class PonderQuestionTransaction
const TYPE_ANSWERS = 'ponder.question:answer'; const TYPE_ANSWERS = 'ponder.question:answer';
const TYPE_STATUS = 'ponder.question:status'; const TYPE_STATUS = 'ponder.question:status';
const MAILTAG_DETAILS = 'question:details';
const MAILTAG_COMMENT = 'question:comment';
const MAILTAG_ANSWERS = 'question:answer';
const MAILTAG_OTHER = 'question:other';
public function getApplicationName() { public function getApplicationName() {
return 'ponder'; return 'ponder';
} }
@ -105,6 +110,28 @@ final class PonderQuestionTransaction
return parent::getTitle(); return parent::getTitle();
} }
public function getMailTags() {
$tags = parent::getMailTags();
switch ($this->getTransactionType()) {
case PhabricatorTransactions::TYPE_COMMENT:
$tags[] = self::MAILTAG_COMMENT;
break;
case self::TYPE_TITLE:
case self::TYPE_CONTENT:
case self::TYPE_STATUS:
$tags[] = self::MAILTAG_DETAILS;
break;
case self::TYPE_ANSWERS:
$tags[] = self::MAILTAG_ANSWERS;
break;
default:
$tags[] = self::MAILTAG_OTHER;
break;
}
return $tags;
}
public function getIcon() { public function getIcon() {
$old = $this->getOldValue(); $old = $this->getOldValue();
$new = $this->getNewValue(); $new = $this->getNewValue();