1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +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:
vrana 2012-01-13 22:22:27 -08:00
parent 95cde81daf
commit 5cf6d788ce
4 changed files with 5 additions and 12 deletions

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -50,7 +50,6 @@ class DifferentialCommentSaveController extends DifferentialController {
->setMessage($comment)
->setContentSource($content_source)
->setAttachInlineComments(true)
->setAddCC($action != DifferentialAction::ACTION_RESIGN)
->setAddedReviewers($reviewers)
->setAddedCCs($ccs)
->save();

View file

@ -8,7 +8,6 @@
phutil_require_module('phabricator', 'aphront/response/400');
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/editor/comment');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -24,7 +24,6 @@ class DifferentialCommentEditor {
protected $attachInlineComments;
protected $message;
protected $addCC;
protected $changedByCommit;
protected $addedReviewers = array();
private $addedCCs = array();
@ -57,11 +56,6 @@ class DifferentialCommentEditor {
return $this;
}
public function setAddCC($add) {
$this->addCC = $add;
return $this;
}
public function setChangedByCommit($changed_by_commit) {
$this->changedByCommit = $changed_by_commit;
return $this;
@ -315,7 +309,9 @@ class DifferentialCommentEditor {
// top of the action list.
$revision->save();
if ($this->addCC) {
if ($action != DifferentialAction::ACTION_RESIGN &&
$this->actorPHID != $revision->getAuthorPHID() &&
!in_array($this->actorPHID, $revision->getReviewers())) {
DifferentialRevisionEditor::addCC(
$revision,
$this->actorPHID,

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (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->setMessage($body);
$editor->setAddCC(($command != DifferentialAction::ACTION_RESIGN));
$comment = $editor->save();
return $comment->getID();