mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-27 09:12:41 +01:00
Fixing a bug in the bot ignore logic to use sender.
Summary: Also added sender to the campfire adapter. This isn't extremely useful as it's just a numeric id, but it allows us to add ignores (specifically having the bot ignore itself). Test Plan: Ran the bot, ignored itself. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4893
This commit is contained in:
parent
0f8984f5a7
commit
eaa72c6155
2 changed files with 2 additions and 1 deletions
|
@ -107,7 +107,7 @@ 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->getSenderNickName(), $ignore)) {
|
if ($ignore && in_array($message->getSender(), $ignore)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,7 @@ extends PhabricatorBaseProtocolAdapter {
|
||||||
|
|
||||||
return id(new PhabricatorBotMessage())
|
return id(new PhabricatorBotMessage())
|
||||||
->setCommand('MESSAGE')
|
->setCommand('MESSAGE')
|
||||||
|
->setSender($m_obj['user_id'])
|
||||||
->setTarget($m_obj['room_id'])
|
->setTarget($m_obj['room_id'])
|
||||||
->setBody($m_obj['body']);
|
->setBody($m_obj['body']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue