mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42: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:
parent
28bdeb6d3e
commit
204d6481e4
1 changed files with 5 additions and 2 deletions
|
@ -107,8 +107,11 @@ final class PhabricatorBot extends PhabricatorDaemon {
|
||||||
|
|
||||||
private function routeMessage(PhabricatorBotMessage $message) {
|
private function routeMessage(PhabricatorBotMessage $message) {
|
||||||
$ignore = $this->getConfig('ignore');
|
$ignore = $this->getConfig('ignore');
|
||||||
if ($ignore && in_array($message->getSender(), $ignore)) {
|
if ($ignore) {
|
||||||
return;
|
$sender = $message->getSender();
|
||||||
|
if ($sender && in_array($sender->getName(), $ignore)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->handlers as $handler) {
|
foreach ($this->handlers as $handler) {
|
||||||
|
|
Loading…
Reference in a new issue