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