2013-05-14 19:57:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver {
|
|
|
|
|
|
|
|
public function isEnabled() {
|
2014-07-23 02:03:09 +02:00
|
|
|
$app_class = 'PhabricatorManiphestApplication';
|
2013-05-14 19:57:41 +02:00
|
|
|
return PhabricatorApplication::isClassInstalled($app_class);
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2013-05-17 19:00:49 +02:00
|
|
|
protected function processReceivedObjectMail(
|
|
|
|
PhabricatorMetaMTAReceivedMail $mail,
|
|
|
|
PhabricatorLiskDAO $object,
|
|
|
|
PhabricatorUser $sender) {
|
|
|
|
|
Remove all application-specific reply handler class overrides
Summary:
Ref T7199. In the vein of D12231, these options were a bad idea.
- They once served a very narrow, Facebook-specific need (see T1992), except even Facebook only used the Differential setting AFAIK.
- Outside of that special case, they are unused and essentially unusable (generally speaking, they do not meaningfully implement anything modular or replaceable).
- I have no knowledge of any install ever changing these settings, and can imagine no reason why they would.
Moving forward:
- If they really need to, they can fork locally and chagne one line.
- I expect "!actions" to make mail at least somewhat more modular soon, anyway.
- Any derived handlers would break after T7199 and need to be rewritten anyway, so this is just taking advantage of a BC break to do cleanup.
Test Plan:
- Grepped for removed configuration.
- Sent some mail from applications, verified the reply handlers set proper reply addresses.
Reviewers: btrahan
Reviewed By: btrahan
Subscribers: epriestley
Maniphest Tasks: T7199
Differential Revision: https://secure.phabricator.com/D12233
2015-04-01 02:22:01 +02:00
|
|
|
$handler = new ManiphestReplyHandler();
|
2013-10-22 01:58:37 +02:00
|
|
|
$handler->setMailReceiver($object);
|
2013-05-17 19:00:49 +02:00
|
|
|
|
|
|
|
$handler->setActor($sender);
|
|
|
|
$handler->setExcludeMailRecipientPHIDs(
|
|
|
|
$mail->loadExcludeMailRecipientPHIDs());
|
|
|
|
$handler->processEmail($mail);
|
|
|
|
}
|
|
|
|
|
2013-05-14 19:57:41 +02:00
|
|
|
}
|