From 3346f04d89548ebfa6e84c6bada01b84bdd15f21 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Wed, 29 Jun 2011 04:33:13 -0400 Subject: [PATCH] Add Pxxx to phabot. Summary: Summarize (or at least link to) pastes when P is given in a channel. This depends on D552! Test Plan: 04:34:03 <@codeblock-phabot> P15 - http://phabricator.local/P15 04:35:22 <@CodeBlock> P1 asdf foo Bar Baz Diet Sprite P4 04:35:24 <@codeblock-phabot> P1 - http://phabricator.local/P1 04:35:24 <@codeblock-phabot> P4 - http://phabricator.local/P4 Reviewers: epriestley CC: Differential Revision: 553 --- .../PhabricatorIRCObjectNameHandler.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php b/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php index 0629c06df8..6b326a8e5f 100644 --- a/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php +++ b/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php @@ -45,12 +45,13 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler { $pattern = '@'. '(?getConduit()->callMethodSynchronous( + 'paste.info', + array( + 'paste_id' => $paste_id, + )); + // Eventually I'd like to show the username of the paster as well, + // however that will need something like a user.username_from_phid + // since we (ideally) want to keep the bot to Conduit calls...and + // not call to Phabricator-specific stuff (like actually loading + // the User object and fetching his/her username.) + $output[$paste['phid']] = 'P'.$paste['id'].': '.$paste['uri']; + } + } + if ($commit_names) { $commits = $this->getConduit()->callMethodSynchronous( 'diffusion.getcommits',