mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
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
This commit is contained in:
parent
8b304870c4
commit
d7fcbd7d39
1 changed files with 2 additions and 1 deletions
|
@ -30,6 +30,7 @@ class PhabricatorIRCDifferentialNotificationHandler
|
||||||
|
|
||||||
public function runBackgroundTasks() {
|
public function runBackgroundTasks() {
|
||||||
$iterator = new PhabricatorTimelineIterator('ircdiffx', array('difx'));
|
$iterator = new PhabricatorTimelineIterator('ircdiffx', array('difx'));
|
||||||
|
$show = $this->getConfig('notification.actions');
|
||||||
|
|
||||||
if (!$this->skippedOldEvents) {
|
if (!$this->skippedOldEvents) {
|
||||||
// Since we only want to post notifications about new events, skip
|
// Since we only want to post notifications about new events, skip
|
||||||
|
@ -44,7 +45,7 @@ class PhabricatorIRCDifferentialNotificationHandler
|
||||||
|
|
||||||
foreach ($iterator as $event) {
|
foreach ($iterator as $event) {
|
||||||
$data = $event->getData();
|
$data = $event->getData();
|
||||||
if (!$data) {
|
if (!$data || ($show !== null && !in_array($data['action'], $show))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue