Differential D17038 Diff 41002 src/applications/differential/conduit/DifferentialConduitAPIMethod.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/conduit/DifferentialConduitAPIMethod.php
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | foreach ($values as $key => $value) { | ||||
} | } | ||||
$xactions[] = $xaction; | $xactions[] = $xaction; | ||||
} | } | ||||
$message = $request->getValue('message'); | $message = $request->getValue('message'); | ||||
if (strlen($message)) { | if (strlen($message)) { | ||||
// This is a little awkward, and should maybe move inside the transaction | // This is a little awkward, and should maybe move inside the transaction | ||||
// editor. It largely exists for legacy reasons. | // editor. It largely exists for legacy reasons. See some discussion in | ||||
// T7899. | |||||
$first_line = head(phutil_split_lines($message, false)); | $first_line = head(phutil_split_lines($message, false)); | ||||
$first_line = id(new PhutilUTF8StringTruncator()) | |||||
->setMaximumBytes(250) | |||||
->setMaximumGlyphs(80) | |||||
->truncateString($first_line); | |||||
$diff->setDescription($first_line); | $diff->setDescription($first_line); | ||||
$diff->save(); | $diff->save(); | ||||
$xactions[] = id(new DifferentialTransaction()) | $xactions[] = id(new DifferentialTransaction()) | ||||
->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT) | ||||
->attachComment( | ->attachComment( | ||||
id(new DifferentialTransactionComment()) | id(new DifferentialTransactionComment()) | ||||
->setContent($message)); | ->setContent($message)); | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |