Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phame/mail/PhamePostMailReceiver.php
<?php | <?php | ||||
final class PhamePostMailReceiver | final class PhamePostMailReceiver | ||||
extends PhabricatorObjectMailReceiver { | extends PhabricatorObjectMailReceiver { | ||||
public function isEnabled() { | public function isEnabled() { | ||||
return PhabricatorApplication::isClassInstalled( | return PhabricatorApplication::isClassInstalled( | ||||
'PhabricatorPhameApplication'); | 'PhabricatorPhameApplication'); | ||||
} | } | ||||
protected function getObjectPattern() { | protected function getObjectPattern() { | ||||
return 'POST[1-9]\d*'; | return 'J[1-9]\d*'; | ||||
} | } | ||||
protected function loadObject($pattern, PhabricatorUser $viewer) { | protected function loadObject($pattern, PhabricatorUser $viewer) { | ||||
$id = (int)substr($pattern, 4); | $id = (int)substr($pattern, 4); | ||||
return id(new PhamePostQuery()) | return id(new PhamePostQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIDs(array($id)) | ->withIDs(array($id)) | ||||
->executeOne(); | ->executeOne(); | ||||
} | } | ||||
protected function getTransactionReplyHandler() { | protected function getTransactionReplyHandler() { | ||||
return new PhamePostReplyHandler(); | return new PhamePostReplyHandler(); | ||||
} | } | ||||
} | } |