mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 20:10:55 +01:00
Fix Differential "unsubscribe" so it properly blocks resubscription
Summary: DifferentialRevision stores this field as a dictionary but the Editor incorrectly passed it to Herald as a raw value array. Ideally the property should be called unsubscribedDict or something but I'm increasingly thinking we're going to centralize subscriptions for Adjutant or some similar system so I'm disinclined to pursue the schema change just yet. I provided an explicit raw-value-oriented API, at least. Test Plan: With two accounts, A and B: created universal Herald CC rule with user B, created a revision with user A, had user B unsubscribe, had user A update the revision. User B was not resubscribed. Reviewed By: aran Reviewers: jungejason, tuomaspelkonen, aran CC: ola, aran, epriestley Differential Revision: 188
This commit is contained in:
parent
864e0d8a2f
commit
b3397030e6
2 changed files with 5 additions and 1 deletions
|
@ -204,7 +204,7 @@ class DifferentialRevisionEditor {
|
|||
$diff);
|
||||
$adapter->setExplicitCCs($new['ccs']);
|
||||
$adapter->setExplicitReviewers($new['rev']);
|
||||
$adapter->setForbiddenCCs($revision->getUnsubscribed());
|
||||
$adapter->setForbiddenCCs($revision->getUnsubscribedPHIDs());
|
||||
|
||||
$xscript = HeraldEngine::loadAndApplyRules($adapter);
|
||||
$xscript_uri = PhabricatorEnv::getProductionURI(
|
||||
|
|
|
@ -151,4 +151,8 @@ class DifferentialRevision extends DifferentialDAO {
|
|||
public function getRawRelations($relation) {
|
||||
return idx($this->relationships, $relation, array());
|
||||
}
|
||||
|
||||
public function getUnsubscribedPHIDs() {
|
||||
return array_keys($this->getUnsubscribed());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue