Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14410878
D10126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10126.diff
View Options
diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php
@@ -4,7 +4,6 @@
private $commit;
private $attachInlineComments;
- private $noEmail;
public function __construct(PhabricatorRepositoryCommit $commit) {
$this->commit = $commit;
@@ -16,11 +15,6 @@
return $this;
}
- public function setNoEmail($no_email) {
- $this->noEmail = $no_email;
- return $this;
- }
-
public function addComments(array $comments) {
assert_instances_of($comments, 'PhabricatorAuditComment');
@@ -62,7 +56,6 @@
->setContinueOnMissingFields(true)
->setContentSource($content_source)
->setExcludeMailRecipientPHIDs($this->getExcludeMailRecipientPHIDs())
- ->setDisableEmail($this->noEmail)
->applyTransactions($commit, $xactions);
}
diff --git a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
@@ -59,7 +59,7 @@
$action = PhabricatorAuditActionConstants::COMMENT;
}
- // Disallow ADD_CCS, ADD_AUDITORS for now
+ // Disallow ADD_CCS, ADD_AUDITORS forever.
if (!in_array($action, array(
PhabricatorAuditActionConstants::CONCERN,
PhabricatorAuditActionConstants::ACCEPT,
@@ -70,27 +70,31 @@
throw new ConduitException('ERR_BAD_ACTION');
}
- $comments = array();
+ $xactions = array();
if ($action != PhabricatorAuditActionConstants::COMMENT) {
- $comments[] = id(new PhabricatorAuditComment())
- ->setAction($action);
+ $xactions[] = id(new PhabricatorAuditTransaction())
+ ->setTransactionType(PhabricatorAuditActionConstants::ACTION)
+ ->setNewValue($action);
}
if (strlen($message)) {
- $comments[] = id(new PhabricatorAuditComment())
- ->setAction(PhabricatorAuditActionConstants::COMMENT)
- ->setContent($message);
+ $xactions[] = id(new PhabricatorAuditTransaction())
+ ->setTransactionType(PhabricatorTransactions::TYPE_COMMENT)
+ ->attachComment(
+ id(new PhabricatorAuditTransactionComment())
+ ->setCommitPHID($commit->getPHID())
+ ->setContent($message));
}
- id(new PhabricatorAuditCommentEditor($commit))
+ id(new PhabricatorAuditEditor())
->setActor($request->getUser())
- ->setNoEmail($request->getValue('silent'))
- ->addComments($comments);
+ ->setContentSourceFromConduitRequest($request)
+ ->setDisableEmail($request->getValue('silent'))
+ ->setContinueOnMissingFields(true)
+ ->applyTransactions($commit, $xactions);
return true;
- // get the full uri of the comment?
- // i.e, PhabricatorEnv::getURI(rXX01ab23cd#comment-9)
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:21 AM (10 h, 25 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6925590
Default Alt Text
D10126.diff (3 KB)
Attached To
Mode
D10126: Apply `diffusion.createcomment` directly with transaction editor in Audit
Attached
Detach File
Event Timeline
Log In to Comment