Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15434078
D15318.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15318.diff
View Options
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;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 1:52 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704835
Default Alt Text
D15318.diff (1 KB)
Attached To
Mode
D15318: Ignore list for PhabricatorBotObjectNameHandler
Attached
Detach File
Event Timeline
Log In to Comment