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

Transactions - don't let objects mention themselves.

Summary: Fixes T6059.

Test Plan: Made a comment on TX mentioning TX and TX+1. TX did not get a "mentioned" transaction while TX+1 did.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T6059

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

+10 -5
+10 -5
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1199 1199 } 1200 1200 } 1201 1201 1202 - $objects = id(new PhabricatorObjectQuery()) 1202 + $mentioned_objects = id(new PhabricatorObjectQuery()) 1203 1203 ->setViewer($this->getActor()) 1204 1204 ->withPHIDs($mentioned_phids) 1205 1205 ->execute(); 1206 1206 1207 1207 $mentionable_phids = array(); 1208 - foreach ($objects as $object) { 1209 - if ($object instanceof PhabricatorMentionableInterface) { 1210 - if (idx($this->getUnmentionablePHIDMap(), $object->getPHID())) { 1208 + foreach ($mentioned_objects as $mentioned_object) { 1209 + if ($mentioned_object instanceof PhabricatorMentionableInterface) { 1210 + $mentioned_phid = $mentioned_object->getPHID(); 1211 + if (idx($this->getUnmentionablePHIDMap(), $mentioned_phid)) { 1212 + continue; 1213 + } 1214 + // don't let objects mention themselves 1215 + if ($object->getPHID() && $mentioned_phid == $object->getPHID()) { 1211 1216 continue; 1212 1217 } 1213 - $mentionable_phids[$object->getPHID()] = $object->getPHID(); 1218 + $mentionable_phids[$mentioned_phid] = $mentioned_phid; 1214 1219 } 1215 1220 } 1216 1221 if ($mentionable_phids) {