2013-05-14 19:57:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialRevisionMailReceiver
|
|
|
|
extends PhabricatorObjectMailReceiver {
|
|
|
|
|
|
|
|
public function isEnabled() {
|
2015-05-22 09:27:56 +02:00
|
|
|
return PhabricatorApplication::isClassInstalled(
|
|
|
|
'PhabricatorDifferentialApplication');
|
2013-05-14 19:57:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function getObjectPattern() {
|
|
|
|
return 'D[1-9]\d*';
|
|
|
|
}
|
|
|
|
|
2013-05-17 12:47:46 +02:00
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
|
|
$id = (int)trim($pattern, 'D');
|
|
|
|
|
2014-04-24 22:47:32 +02:00
|
|
|
return id(new DifferentialRevisionQuery())
|
2013-05-17 12:47:46 +02:00
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($id))
|
2014-03-07 17:10:18 +01:00
|
|
|
->needReviewerStatus(true)
|
2014-04-24 22:47:32 +02:00
|
|
|
->needReviewerAuthority(true)
|
|
|
|
->needActiveDiffs(true)
|
|
|
|
->executeOne();
|
2013-05-17 12:47:46 +02:00
|
|
|
}
|
|
|
|
|
2015-04-01 20:01:21 +02:00
|
|
|
protected function getTransactionReplyHandler() {
|
|
|
|
return new DifferentialReplyHandler();
|
2013-05-17 19:00:49 +02:00
|
|
|
}
|
2013-05-17 12:47:46 +02:00
|
|
|
|
2013-05-14 19:57:41 +02:00
|
|
|
}
|