mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 10:41:08 +01:00
Add language to paste.info, and show it in Pxxx responses from phabot.
Summary: Now that we store language with pastes, we can include this in Conduit. Test Plan: Tried it on a paste with a blank language, and one with a specified language. 16:14:50 <@CodeBlock> P1 16:14:51 <@codeblock-phabot> P1: http://phabricator.local/P1 - test.php 16:15:05 <@CodeBlock> P43 16:15:06 <@codeblock-phabot> P43: http://phabricator.local/P43 - sadoijfoisaf (php) Reviewers: epriestley, Ttech CC: Differential Revision: 616
This commit is contained in:
parent
395ccf8a51
commit
3d85d6a81d
2 changed files with 7 additions and 1 deletions
|
@ -55,6 +55,7 @@ class ConduitAPI_paste_info_Method extends ConduitAPIMethod {
|
||||||
'filePHID' => $paste->getFilePHID(),
|
'filePHID' => $paste->getFilePHID(),
|
||||||
'title' => $paste->getTitle(),
|
'title' => $paste->getTitle(),
|
||||||
'dateCreated' => $paste->getDateCreated(),
|
'dateCreated' => $paste->getDateCreated(),
|
||||||
|
'language' => $paste->getLanguage(),
|
||||||
'uri' => PhabricatorEnv::getProductionURI('/P'.$paste->getID()),
|
'uri' => PhabricatorEnv::getProductionURI('/P'.$paste->getID()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,12 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
|
||||||
// since we (ideally) want to keep the bot to Conduit calls...and
|
// since we (ideally) want to keep the bot to Conduit calls...and
|
||||||
// not call to Phabricator-specific stuff (like actually loading
|
// not call to Phabricator-specific stuff (like actually loading
|
||||||
// the User object and fetching his/her username.)
|
// the User object and fetching his/her username.)
|
||||||
$output[$paste['phid']] = 'P'.$paste['id'].': '.$paste['uri'].' - '.$paste['title'];
|
$output[$paste['phid']] = 'P'.$paste['id'].': '.$paste['uri'].' - '.
|
||||||
|
$paste['title'];
|
||||||
|
|
||||||
|
if ($paste['language']) {
|
||||||
|
$output[$paste['phid']] .= ' ('.$paste['language'].')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue