diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php --- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php +++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php @@ -11,9 +11,31 @@ */ private $recentlyMentioned = array(); + /** + * Checks if the message sender should be shown. The senders ignore list + * is stored in the bot configuration, at ignores.objects key. + * + * @param PhabricatorBotMessage The message sent to the bot + * @return bool + */ + private function shouldShowLink(PhabricatorBotMessage $message) { + $ignores = $this->getConfig('ignores.objects', []); + + $sender = $message->getSender(); + if ($sender !== null && in_array($sender->getName(), $ignores)) { + return false; + } + + return true; + } + public function receiveMessage(PhabricatorBotMessage $original_message) { switch ($original_message->getCommand()) { case 'MESSAGE': + if (!$this->shouldShowLink($original_message)) { + return false; + } + $message = $original_message->getBody(); $matches = null;