2013-08-06 02:11:46 +02:00
|
|
|
<?php
|
|
|
|
|
2015-04-01 17:39:21 +02:00
|
|
|
final class PasteMailReceiver extends PhabricatorObjectMailReceiver {
|
2013-08-06 02:11:46 +02:00
|
|
|
|
|
|
|
public function isEnabled() {
|
2014-07-23 02:03:09 +02:00
|
|
|
$app_class = 'PhabricatorPasteApplication';
|
2013-08-06 02:11:46 +02:00
|
|
|
return PhabricatorApplication::isClassInstalled($app_class);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function getObjectPattern() {
|
|
|
|
return 'P[1-9]\d*';
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function loadObject($pattern, PhabricatorUser $viewer) {
|
|
|
|
$id = (int)trim($pattern, 'P');
|
|
|
|
|
|
|
|
return id(new PhabricatorPasteQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($id))
|
|
|
|
->executeOne();
|
|
|
|
}
|
|
|
|
|
2015-04-01 20:01:21 +02:00
|
|
|
protected function getTransactionReplyHandler() {
|
|
|
|
return new PasteReplyHandler();
|
2013-08-06 02:11:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|