From d7fcbd7d39c2d3287d1ea42c129cb5ccfd99728e Mon Sep 17 00:00:00 2001 From: Korvin Szanto Date: Wed, 7 Mar 2012 18:46:05 -0800 Subject: [PATCH] Adding explicitly set ircbot notifications Summary: This adds a new configuration setting: "notification.actions" : [ "commit", "abandon", "actions" ] if not set, displays all actions, if is set, display only what is set to display Test Plan: add the notification.actions settings and set accordingly Reviewers: epriestley, zeeg CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1820 --- .../PhabricatorIRCDifferentialNotificationHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/daemon/irc/handler/differentialnotification/PhabricatorIRCDifferentialNotificationHandler.php b/src/infrastructure/daemon/irc/handler/differentialnotification/PhabricatorIRCDifferentialNotificationHandler.php index cdbe7eaf21..843fc8694b 100644 --- a/src/infrastructure/daemon/irc/handler/differentialnotification/PhabricatorIRCDifferentialNotificationHandler.php +++ b/src/infrastructure/daemon/irc/handler/differentialnotification/PhabricatorIRCDifferentialNotificationHandler.php @@ -30,6 +30,7 @@ class PhabricatorIRCDifferentialNotificationHandler public function runBackgroundTasks() { $iterator = new PhabricatorTimelineIterator('ircdiffx', array('difx')); + $show = $this->getConfig('notification.actions'); if (!$this->skippedOldEvents) { // Since we only want to post notifications about new events, skip @@ -44,7 +45,7 @@ class PhabricatorIRCDifferentialNotificationHandler foreach ($iterator as $event) { $data = $event->getData(); - if (!$data) { + if (!$data || ($show !== null && !in_array($data['action'], $show))) { continue; }