1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

Pass actor to revision unsubscriber editor

Summary: I wonder how I tested this.

Test Plan: Subscribed, unsubscribed.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4860
This commit is contained in:
vrana 2013-02-07 18:13:38 -08:00
parent 714a3cc536
commit 7063ee638e
3 changed files with 9 additions and 7 deletions

View file

@ -172,7 +172,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
DifferentialRevisionEditor::removeCCAndUpdateRevision( DifferentialRevisionEditor::removeCCAndUpdateRevision(
$revision, $revision,
$user->getPHID(), $user->getPHID(),
$user->getPHID()); $user);
} }

View file

@ -59,13 +59,13 @@ final class DifferentialSubscribeController extends DifferentialController {
DifferentialRevisionEditor::addCCAndUpdateRevision( DifferentialRevisionEditor::addCCAndUpdateRevision(
$revision, $revision,
$phid, $phid,
$phid); $user);
break; break;
case 'rem': case 'rem':
DifferentialRevisionEditor::removeCCAndUpdateRevision( DifferentialRevisionEditor::removeCCAndUpdateRevision(
$revision, $revision,
$phid, $phid,
$phid); $user);
break; break;
default: default:
return new Aphront400Response(); return new Aphront400Response();

View file

@ -496,12 +496,13 @@ final class DifferentialRevisionEditor extends PhabricatorEditor {
public static function addCCAndUpdateRevision( public static function addCCAndUpdateRevision(
$revision, $revision,
$phid, $phid,
$reason) { PhabricatorUser $actor) {
self::addCC($revision, $phid, $reason); self::addCC($revision, $phid, $actor->getPHID());
$type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER; $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER;
id(new PhabricatorEdgeEditor()) id(new PhabricatorEdgeEditor())
->setActor($actor)
->removeEdge($revision->getPHID(), $type, $phid) ->removeEdge($revision->getPHID(), $type, $phid)
->save(); ->save();
} }
@ -509,12 +510,13 @@ final class DifferentialRevisionEditor extends PhabricatorEditor {
public static function removeCCAndUpdateRevision( public static function removeCCAndUpdateRevision(
$revision, $revision,
$phid, $phid,
$reason) { PhabricatorUser $actor) {
self::removeCC($revision, $phid, $reason); self::removeCC($revision, $phid, $actor->getPHID());
$type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER; $type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_UNSUBSCRIBER;
id(new PhabricatorEdgeEditor()) id(new PhabricatorEdgeEditor())
->setActor($actor)
->addEdge($revision->getPHID(), $type, $phid) ->addEdge($revision->getPHID(), $type, $phid)
->save(); ->save();
} }