1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 15:22: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:
indiefan 2013-02-09 16:10:16 -08:00 committed by epriestley
parent 0f8984f5a7
commit eaa72c6155
2 changed files with 2 additions and 1 deletions

View file

@ -107,7 +107,7 @@ final class PhabricatorBot extends PhabricatorDaemon {
private function routeMessage(PhabricatorBotMessage $message) {
$ignore = $this->getConfig('ignore');
if ($ignore && in_array($message->getSenderNickName(), $ignore)) {
if ($ignore && in_array($message->getSender(), $ignore)) {
return;
}

View file

@ -118,6 +118,7 @@ extends PhabricatorBaseProtocolAdapter {
return id(new PhabricatorBotMessage())
->setCommand('MESSAGE')
->setSender($m_obj['user_id'])
->setTarget($m_obj['room_id'])
->setBody($m_obj['body']);
}