Page MenuHomePhabricator

D11664.diff
No OneTemporary

D11664.diff

diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotObjectNameHandler.php
@@ -131,21 +131,28 @@
if ($paste_ids) {
foreach ($paste_ids as $paste_id) {
$paste = $this->getConduit()->callMethodSynchronous(
- 'paste.info',
+ 'paste.query',
array(
- 'paste_id' => $paste_id,
+ 'ids' => array($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.)
+ $paste = head($paste);
+
$output[$paste['phid']] = 'P'.$paste['id'].': '.$paste['uri'].' - '.
$paste['title'];
if ($paste['language']) {
$output[$paste['phid']] .= ' ('.$paste['language'].')';
}
+
+ $user = $this->getConduit()->callMethodSynchronous(
+ 'user.query',
+ array(
+ 'phids' => array($paste['authorPHID']),
+ ));
+ $user = head($user);
+ if ($user) {
+ $output[$paste['phid']] .= ' by '.$user['userName'];
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Oct 15 2024, 6:15 AM (5 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711658
Default Alt Text
D11664.diff (1 KB)

Event Timeline