@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.

Allow notifications to be published as read if the user also is getting an email

Summary: See discussion in T1403. Possibly we'll add a preference for this or something?

Test Plan: Not yet in use. See future diff.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1403

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

+15 -1
+15 -1
src/applications/feed/PhabricatorFeedStoryPublisher.php
··· 25 25 private $storyAuthorPHID; 26 26 private $primaryObjectPHID; 27 27 private $subscribedPHIDs = array(); 28 + private $mailRecipientPHIDs = array(); 28 29 29 30 public function setRelatedPHIDs(array $phids) { 30 31 $this->relatedPHIDs = $phids; ··· 57 58 58 59 public function setStoryAuthorPHID($phid) { 59 60 $this->storyAuthorPHID = $phid; 61 + return $this; 62 + } 63 + 64 + public function setMailRecipientPHIDs(array $phids) { 65 + $this->mailRecipientPHIDs = $phids; 60 66 return $this; 61 67 } 62 68 ··· 136 142 $sql = array(); 137 143 $conn = $notif->establishConnection('w'); 138 144 145 + $will_receive_mail = array_fill_keys($this->mailRecipientPHIDs, true); 146 + 139 147 foreach (array_unique($subscribed_phids) as $user_phid) { 148 + if (isset($will_receive_mail[$user_phid])) { 149 + $mark_read = 1; 150 + } else { 151 + $mark_read = 0; 152 + } 153 + 140 154 $sql[] = qsprintf( 141 155 $conn, 142 156 '(%s, %s, %s, %d)', 143 157 $this->primaryObjectPHID, 144 158 $user_phid, 145 159 $chrono_key, 146 - 0); 160 + $mark_read); 147 161 } 148 162 149 163 queryfx(