@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adjust action strength of self subscribe/unsubscribe

Summary:
Ref T4968. If you add a comment to revision you aren't currently subscribed to, the email currently chooses "[Changed Subscribers]" as the action title. This is less interesting than "[Commented]", provided the affected subscriber is you (adding other people //is// usually interesting).

In this case, reduce the strength of this action below the strength of "comment".

Test Plan: Made several comments in conjunction with implicit and explicit subscriptions. Saw "[Commented]" for stuff affecting me, and "[Changed Subscribers]" for stuff affecting others.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4968

Differential Revision: https://secure.phabricator.com/D9168

+27
+27
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 780 780 switch ($this->getTransactionType()) { 781 781 case PhabricatorTransactions::TYPE_COMMENT: 782 782 return 0.5; 783 + case PhabricatorTransactions::TYPE_SUBSCRIBERS: 784 + $old = $this->getOldValue(); 785 + $new = $this->getNewValue(); 786 + 787 + $add = array_diff($old, $new); 788 + $rem = array_diff($new, $old); 789 + 790 + // If this action is the actor subscribing or unsubscribing themselves, 791 + // it is less interesting. In particular, if someone makes a comment and 792 + // also implicitly subscribes themselves, we should treat the 793 + // transaction group as "comment", not "subscribe". In this specific 794 + // case (one affected user, and that affected user it the actor), 795 + // decrease the action strength. 796 + 797 + if ((count($add) + count($rem)) != 1) { 798 + // Not exactly one CC change. 799 + break; 800 + } 801 + 802 + $affected_phid = head(array_merge($add, $rem)); 803 + if ($affected_phid != $this->getAuthorPHID()) { 804 + // Affected user is someone else. 805 + break; 806 + } 807 + 808 + // Make this weaker than TYPE_COMMENT. 809 + return 0.25; 783 810 } 784 811 return 1.0; 785 812 }