Page MenuHomePhabricator

D10274.id24755.diff
No OneTemporary

D10274.id24755.diff

diff --git a/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php b/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
--- a/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
+++ b/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
@@ -72,7 +72,8 @@
'uri' => $file->getBestURI(),
'phid' => $macro->getPHID(),
'authorPHID' => $file->getAuthorPHID(),
- 'dateCreated' => $file->getDateCreated(),
+ 'dateCreated' => $file->getDateCreated(),
+ 'filePHID' => $file->getPHID(),
);
}
diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php
@@ -82,7 +82,17 @@
}
public function rasterize($macro, $size, $aspect) {
- $image = HTTPSFuture::loadContent($macro['uri']);
+ try {
+ $image = $this->getConduit()->callMethodSynchronous(
+ 'file.download',
+ array(
+ 'phid' => $macro['filePHID'],
+ ));
+ $image = base64_decode($image);
+ } catch (Exception $ex) {
+ return false;
+ }
+
if (!$image) {
return false;
}

File Metadata

Mime Type
text/plain
Expires
Sat, May 18, 5:51 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6287845
Default Alt Text
D10274.id24755.diff (1 KB)

Event Timeline