[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/files/mail/ -> FileMailReceiver.php (source)

   1  <?php
   2  
   3  final class FileMailReceiver extends PhabricatorObjectMailReceiver {
   4  
   5    public function isEnabled() {
   6      $app_class = 'PhabricatorFilesApplication';
   7      return PhabricatorApplication::isClassInstalled($app_class);
   8    }
   9  
  10    protected function getObjectPattern() {
  11      return 'F[1-9]\d*';
  12    }
  13  
  14    protected function loadObject($pattern, PhabricatorUser $viewer) {
  15      $id = (int)trim($pattern, 'F');
  16  
  17      return id(new PhabricatorPasteQuery())
  18        ->setViewer($viewer)
  19        ->withIDs(array($id))
  20        ->executeOne();
  21    }
  22  
  23    protected function processReceivedObjectMail(
  24      PhabricatorMetaMTAReceivedMail $mail,
  25      PhabricatorLiskDAO $object,
  26      PhabricatorUser $sender) {
  27  
  28      $handler = id(new FileReplyHandler())
  29        ->setMailReceiver($object);
  30  
  31      $handler->setActor($sender);
  32      $handler->setExcludeMailRecipientPHIDs(
  33        $mail->loadExcludeMailRecipientPHIDs());
  34      $handler->processEmail($mail);
  35    }
  36  
  37  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1