mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Add Mailtags to Paste
Summary: Fixes T7786. Adds very basic mailtag support. Test Plan: Tested changing language, title to a Paste, didn't get notifications on my test account. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7786 Differential Revision: https://secure.phabricator.com/D12404
This commit is contained in:
parent
0acdf256fc
commit
ca5909cac6
2 changed files with 33 additions and 0 deletions
|
@ -153,6 +153,17 @@ final class PhabricatorPasteEditor
|
|||
);
|
||||
}
|
||||
|
||||
public function getMailTagsMap() {
|
||||
return array(
|
||||
PhabricatorPasteTransaction::MAILTAG_CONTENT =>
|
||||
pht('Paste title, language or text changes.'),
|
||||
PhabricatorPasteTransaction::MAILTAG_COMMENT =>
|
||||
pht('Someone comments on a paste.'),
|
||||
PhabricatorPasteTransaction::MAILTAG_OTHER =>
|
||||
pht('Other paste activity not listed above occurs.'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function buildReplyHandler(PhabricatorLiskDAO $object) {
|
||||
return id(new PasteReplyHandler())
|
||||
->setMailReceiver($object);
|
||||
|
|
|
@ -7,6 +7,10 @@ final class PhabricatorPasteTransaction
|
|||
const TYPE_TITLE = 'paste.title';
|
||||
const TYPE_LANGUAGE = 'paste.language';
|
||||
|
||||
const MAILTAG_CONTENT = 'paste-content';
|
||||
const MAILTAG_OTHER = 'paste-other';
|
||||
const MAILTAG_COMMENT = 'paste-comment';
|
||||
|
||||
public function getApplicationName() {
|
||||
return 'pastebin';
|
||||
}
|
||||
|
@ -182,4 +186,22 @@ final class PhabricatorPasteTransaction
|
|||
return parent::renderChangeDetails($viewer);
|
||||
}
|
||||
|
||||
public function getMailTags() {
|
||||
$tags = array();
|
||||
switch ($this->getTransactionType()) {
|
||||
case self::TYPE_TITLE:
|
||||
case self::TYPE_CONTENT:
|
||||
case self::TYPE_LANGUAGE:
|
||||
$tags[] = self::MAILTAG_CONTENT;
|
||||
break;
|
||||
case PhabricatorTransactions::TYPE_COMMENT:
|
||||
$tags[] = self::MAILTAG_COMMENT;
|
||||
break;
|
||||
default:
|
||||
$tags[] = self::MAILTAG_OTHER;
|
||||
break;
|
||||
}
|
||||
return $tags;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue