Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13956568
D11664.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
D11664.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11664: Phabot / Conduit - stop using deprecated conduit api paste.info
Attached
Detach File
Event Timeline
Log In to Comment