Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14025267
D8524.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8524.diff
View Options
diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotFeedNotificationHandler.php
@@ -11,14 +11,16 @@
private $startupDelay = 30;
private $lastSeenChronoKey = 0;
+ private $typesNeedURI = array('DREV', 'TASK');
+
private function shouldShowStory($story) {
- $story_class = $story['class'];
+ $story_objectphid = $story['objectPHID'];
$story_text = $story['text'];
$show = $this->getConfig('notification.types');
if ($show) {
- $obj_type = str_replace('PhabricatorFeedStory', '', $story_class);
+ $obj_type = phid_get_type($story_objectphid);
if (!in_array(strtolower($obj_type), $show)) {
return false;
}
@@ -62,6 +64,8 @@
'closed',
'raised',
'committed',
+ 'abandoned',
+ 'reclaimed',
'reopened',
'deleted'
);
@@ -148,6 +152,18 @@
continue;
}
+ $message = $story['text'];
+
+ $story_object_type = phid_get_type($story['objectPHID']);
+ if (in_array($story_object_type, $this->typesNeedURI)) {
+ $objects = $this->getConduit()->callMethodSynchronous(
+ 'phid.lookup',
+ array(
+ 'names' => array($story['objectPHID']),
+ ));
+ $message .= ' '.$objects[$story['objectPHID']]['uri'];
+ }
+
$channels = $this->getConfig('join');
foreach ($channels as $channel_name) {
@@ -158,7 +174,7 @@
id(new PhabricatorBotMessage())
->setCommand('MESSAGE')
->setTarget($channel)
- ->setBody($story['text']));
+ ->setBody($message));
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 3:46 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712050
Default Alt Text
D8524.diff (1 KB)
Attached To
Mode
D8524: Make PhabricatorBotFeedNotificationHandler work with new PhabricatorApplicationTransactionFeedStory
Attached
Detach File
Event Timeline
Log In to Comment