1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Fix PhabricatorBot ignore messages from senders

Summary:
PhabricatorBotMessage->getSender returns a PhabricatorBotUser object (which potentially can be null)
So check null and then use getName to get actual name of the sender

Test Plan: Run phabot and add myself to ignore list

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5036
This commit is contained in:
John Watson 2013-02-20 12:30:06 -08:00 committed by epriestley
parent 28bdeb6d3e
commit 204d6481e4

View file

@ -107,8 +107,11 @@ final class PhabricatorBot extends PhabricatorDaemon {
private function routeMessage(PhabricatorBotMessage $message) {
$ignore = $this->getConfig('ignore');
if ($ignore && in_array($message->getSender(), $ignore)) {
return;
if ($ignore) {
$sender = $message->getSender();
if ($sender && in_array($sender->getName(), $ignore)) {
return;
}
}
foreach ($this->handlers as $handler) {