mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 13:00:56 +01:00
Don't add author and reviewers to CCs
Summary: Commenting on a diff causes adding the writer to the CCs. It doesn't make much sense if the writer is author or reviewer who get all the copies anyway. I've also moved the decision to DifferentialCommentEditor. Test Plan: Comment on a diff where I am author Comment on a diff where I am reviewer Comment on a diff where I am neither Explicitely Add CCs where I am author Reviewers: epriestley Reviewed By: epriestley CC: jungejason, aran, epriestley Differential Revision: https://secure.phabricator.com/D1397
This commit is contained in:
parent
95cde81daf
commit
5cf6d788ce
4 changed files with 5 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -50,7 +50,6 @@ class DifferentialCommentSaveController extends DifferentialController {
|
||||||
->setMessage($comment)
|
->setMessage($comment)
|
||||||
->setContentSource($content_source)
|
->setContentSource($content_source)
|
||||||
->setAttachInlineComments(true)
|
->setAttachInlineComments(true)
|
||||||
->setAddCC($action != DifferentialAction::ACTION_RESIGN)
|
|
||||||
->setAddedReviewers($reviewers)
|
->setAddedReviewers($reviewers)
|
||||||
->setAddedCCs($ccs)
|
->setAddedCCs($ccs)
|
||||||
->save();
|
->save();
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/response/400');
|
phutil_require_module('phabricator', 'aphront/response/400');
|
||||||
phutil_require_module('phabricator', 'aphront/response/redirect');
|
phutil_require_module('phabricator', 'aphront/response/redirect');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/controller/base');
|
phutil_require_module('phabricator', 'applications/differential/controller/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/editor/comment');
|
phutil_require_module('phabricator', 'applications/differential/editor/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -24,7 +24,6 @@ class DifferentialCommentEditor {
|
||||||
|
|
||||||
protected $attachInlineComments;
|
protected $attachInlineComments;
|
||||||
protected $message;
|
protected $message;
|
||||||
protected $addCC;
|
|
||||||
protected $changedByCommit;
|
protected $changedByCommit;
|
||||||
protected $addedReviewers = array();
|
protected $addedReviewers = array();
|
||||||
private $addedCCs = array();
|
private $addedCCs = array();
|
||||||
|
@ -57,11 +56,6 @@ class DifferentialCommentEditor {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAddCC($add) {
|
|
||||||
$this->addCC = $add;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setChangedByCommit($changed_by_commit) {
|
public function setChangedByCommit($changed_by_commit) {
|
||||||
$this->changedByCommit = $changed_by_commit;
|
$this->changedByCommit = $changed_by_commit;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -315,7 +309,9 @@ class DifferentialCommentEditor {
|
||||||
// top of the action list.
|
// top of the action list.
|
||||||
$revision->save();
|
$revision->save();
|
||||||
|
|
||||||
if ($this->addCC) {
|
if ($action != DifferentialAction::ACTION_RESIGN &&
|
||||||
|
$this->actorPHID != $revision->getAuthorPHID() &&
|
||||||
|
!in_array($this->actorPHID, $revision->getReviewers())) {
|
||||||
DifferentialRevisionEditor::addCC(
|
DifferentialRevisionEditor::addCC(
|
||||||
$revision,
|
$revision,
|
||||||
$this->actorPHID,
|
$this->actorPHID,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -154,7 +154,6 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
|
||||||
$editor->setParentMessageID($this->receivedMail->getMessageID());
|
$editor->setParentMessageID($this->receivedMail->getMessageID());
|
||||||
}
|
}
|
||||||
$editor->setMessage($body);
|
$editor->setMessage($body);
|
||||||
$editor->setAddCC(($command != DifferentialAction::ACTION_RESIGN));
|
|
||||||
$comment = $editor->save();
|
$comment = $editor->save();
|
||||||
|
|
||||||
return $comment->getID();
|
return $comment->getID();
|
||||||
|
|
Loading…
Reference in a new issue