2013-05-14 10:57:41 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver {
|
|
|
|
|
|
|
|
public function isEnabled() {
|
2015-05-22 17:27:56 +10:00
|
|
|
return PhabricatorApplication::isClassInstalled(
|
|
|
|
'PhabricatorManiphestApplication');
|
2013-05-14 10:57:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function getObjectPattern() {
|
|
|
|
return 'T[1-9]\d*';
|
|
|
|
}
|
|
|
|
|
2013-05-17 03:47:46 -07:00
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
|
|
$id = (int)trim($pattern, 'T');
|
|
|
|
|
|
|
|
$results = id(new ManiphestTaskQuery())
|
|
|
|
->setViewer($viewer)
|
2013-09-10 07:47:55 -07:00
|
|
|
->withIDs(array($id))
|
2014-12-10 16:27:30 -08:00
|
|
|
->needSubscriberPHIDs(true)
|
2014-12-18 13:53:45 -08:00
|
|
|
->needProjectPHIDs(true)
|
2013-05-17 03:47:46 -07:00
|
|
|
->execute();
|
|
|
|
|
|
|
|
return head($results);
|
|
|
|
}
|
|
|
|
|
2015-04-01 11:01:21 -07:00
|
|
|
protected function getTransactionReplyHandler() {
|
|
|
|
return new ManiphestReplyHandler();
|
2013-05-17 10:00:49 -07:00
|
|
|
}
|
|
|
|
|
2013-05-14 10:57:41 -07:00
|
|
|
}
|