1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Allow mail replies to Phame Posts

Summary: Adds mail reply support to Phame Posts.

Test Plan: Comment on a post, get mail.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T9746

Differential Revision: https://secure.phabricator.com/D14454
This commit is contained in:
Chad Little 2015-11-10 17:41:05 +00:00 committed by chad
parent 2b5bb642c0
commit 3747a35476
3 changed files with 30 additions and 4 deletions

View file

@ -3280,6 +3280,7 @@ phutil_register_library_map(array(
'PhamePostEditor' => 'applications/phame/editor/PhamePostEditor.php',
'PhamePostFramedController' => 'applications/phame/controller/post/PhamePostFramedController.php',
'PhamePostListController' => 'applications/phame/controller/post/PhamePostListController.php',
'PhamePostMailReceiver' => 'applications/phame/mail/PhamePostMailReceiver.php',
'PhamePostNewController' => 'applications/phame/controller/post/PhamePostNewController.php',
'PhamePostNotLiveController' => 'applications/phame/controller/post/PhamePostNotLiveController.php',
'PhamePostPreviewController' => 'applications/phame/controller/post/PhamePostPreviewController.php',
@ -7561,6 +7562,7 @@ phutil_register_library_map(array(
'PhamePostEditor' => 'PhabricatorApplicationTransactionEditor',
'PhamePostFramedController' => 'PhamePostController',
'PhamePostListController' => 'PhamePostController',
'PhamePostMailReceiver' => 'PhabricatorObjectMailReceiver',
'PhamePostNewController' => 'PhamePostController',
'PhamePostNotLiveController' => 'PhamePostController',
'PhamePostPreviewController' => 'PhamePostController',

View file

@ -0,0 +1,28 @@
<?php
final class PhamePostMailReceiver
extends PhabricatorObjectMailReceiver {
public function isEnabled() {
return PhabricatorApplication::isClassInstalled(
'PhabricatorPhameApplication');
}
protected function getObjectPattern() {
return 'POST[1-9]\d*';
}
protected function loadObject($pattern, PhabricatorUser $viewer) {
$id = (int)substr($pattern, 4);
return id(new PhamePostQuery())
->setViewer($viewer)
->withIDs(array($id))
->executeOne();
}
protected function getTransactionReplyHandler() {
return new PhamePostReplyHandler();
}
}

View file

@ -14,8 +14,4 @@ final class PhamePostReplyHandler
return PhabricatorPhamePostPHIDType::TYPECONST;
}
protected function shouldCreateCommentFromMailBody() {
return false;
}
}