diff --git a/src/applications/conduit/method/paste/info/ConduitAPI_paste_info_Method.php b/src/applications/conduit/method/paste/info/ConduitAPI_paste_info_Method.php index 31831450ba..45cbde1882 100644 --- a/src/applications/conduit/method/paste/info/ConduitAPI_paste_info_Method.php +++ b/src/applications/conduit/method/paste/info/ConduitAPI_paste_info_Method.php @@ -52,6 +52,7 @@ class ConduitAPI_paste_info_Method extends ConduitAPIMethod { 'filePHID' => $paste->getFilePHID(), 'title' => $paste->getTitle(), 'dateCreated' => $paste->getDateCreated(), + 'uri' => PhabricatorEnv::getProductionURI('/P'.$paste->getID()), ); return $result; diff --git a/src/applications/conduit/method/paste/info/__init__.php b/src/applications/conduit/method/paste/info/__init__.php index 1a92ec47f0..eafc577b4e 100644 --- a/src/applications/conduit/method/paste/info/__init__.php +++ b/src/applications/conduit/method/paste/info/__init__.php @@ -9,6 +9,7 @@ phutil_require_module('phabricator', 'applications/conduit/method/base'); phutil_require_module('phabricator', 'applications/conduit/protocol/exception'); phutil_require_module('phabricator', 'applications/paste/storage/paste'); +phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phutil', 'utils'); diff --git a/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php b/src/infrastructure/daemon/irc/handler/objectname/PhabricatorIRCObjectNameHandler.php index 312ea02ffe..4b8e45bd95 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',