Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/editor/ConpherenceEditor.php
Show All 28 Lines | if (empty($participant_phids)) { | ||||
$conpherence->setRecentParticipantPHIDs( | $conpherence->setRecentParticipantPHIDs( | ||||
array_slice($participant_phids, 0, 10)); | array_slice($participant_phids, 0, 10)); | ||||
} | } | ||||
if (empty($message)) { | if (empty($message)) { | ||||
$errors[] = self::ERROR_EMPTY_MESSAGE; | $errors[] = self::ERROR_EMPTY_MESSAGE; | ||||
} | } | ||||
$file_phids = | $file_phids = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( | ||||
PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( | $creator, | ||||
array($message)); | array($message)); | ||||
if ($file_phids) { | if ($file_phids) { | ||||
$files = id(new PhabricatorFileQuery()) | $files = id(new PhabricatorFileQuery()) | ||||
->setViewer($creator) | ->setViewer($creator) | ||||
->withPHIDs($file_phids) | ->withPHIDs($file_phids) | ||||
->execute(); | ->execute(); | ||||
} | } | ||||
if (!$errors) { | if (!$errors) { | ||||
Show All 25 Lines | if (!$errors) { | ||||
->applyTransactions($conpherence, $xactions); | ->applyTransactions($conpherence, $xactions); | ||||
} | } | ||||
return array($errors, $conpherence); | return array($errors, $conpherence); | ||||
} | } | ||||
public function generateTransactionsFromText( | public function generateTransactionsFromText( | ||||
PhabricatorUser $viewer, | |||||
ConpherenceThread $conpherence, | ConpherenceThread $conpherence, | ||||
$text) { | $text) { | ||||
$files = array(); | $files = array(); | ||||
$file_phids = | $file_phids = PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( | ||||
PhabricatorMarkupEngine::extractFilePHIDsFromEmbeddedFiles( | $viewer, | ||||
array($text)); | array($text)); | ||||
// Since these are extracted from text, we might be re-including the | // Since these are extracted from text, we might be re-including the | ||||
// same file -- e.g. a mock under discussion. Filter files we | // same file -- e.g. a mock under discussion. Filter files we | ||||
// already have. | // already have. | ||||
$existing_file_phids = $conpherence->getFilePHIDs(); | $existing_file_phids = $conpherence->getFilePHIDs(); | ||||
$file_phids = array_diff($file_phids, $existing_file_phids); | $file_phids = array_diff($file_phids, $existing_file_phids); | ||||
if ($file_phids) { | if ($file_phids) { | ||||
$files = id(new PhabricatorFileQuery()) | $files = id(new PhabricatorFileQuery()) | ||||
->setViewer($this->getActor()) | ->setViewer($this->getActor()) | ||||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |