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