Changeset View
Changeset View
Standalone View
Standalone View
src/applications/paste/mail/PasteCreateMailReceiver.php
Show All 18 Lines | protected function processReceivedMail( | ||||
$title = $mail->getSubject(); | $title = $mail->getSubject(); | ||||
if (!$title) { | if (!$title) { | ||||
$title = pht('Email Paste'); | $title = pht('Email Paste'); | ||||
} | } | ||||
$xactions = array(); | $xactions = array(); | ||||
$xactions[] = id(new PhabricatorPasteTransaction()) | $xactions[] = id(new PhabricatorPasteTransaction()) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_CONTENT) | ->setTransactionType(PhabricatorPasteContentTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($mail->getCleanTextBody()); | ->setNewValue($mail->getCleanTextBody()); | ||||
$xactions[] = id(new PhabricatorPasteTransaction()) | $xactions[] = id(new PhabricatorPasteTransaction()) | ||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_TITLE) | ->setTransactionType(PhabricatorPasteTitleTransaction::TRANSACTIONTYPE) | ||||
->setNewValue($title); | ->setNewValue($title); | ||||
$xactions[] = id(new PhabricatorPasteTransaction()) | |||||
->setTransactionType(PhabricatorPasteTransaction::TYPE_LANGUAGE) | |||||
->setNewValue(''); // auto-detect | |||||
$paste = PhabricatorPaste::initializeNewPaste($sender); | $paste = PhabricatorPaste::initializeNewPaste($sender); | ||||
$content_source = $mail->newContentSource(); | $content_source = $mail->newContentSource(); | ||||
$editor = id(new PhabricatorPasteEditor()) | $editor = id(new PhabricatorPasteEditor()) | ||||
->setActor($sender) | ->setActor($sender) | ||||
->setContentSource($content_source) | ->setContentSource($content_source) | ||||
->setContinueOnNoEffect(true); | ->setContinueOnNoEffect(true); | ||||
Show All 24 Lines |