@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use `file.download` to retrieve macro images in the IRC macro bot

Summary: Fixes T5884. Macro images are no longer public on most installs. We could generate tokens for them, but this (using Conduit to pull the file data) is easier and more correct.

Test Plan: Logged a bot into IRC and had it spam part of a macro before being killed for flooding.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5884

Differential Revision: https://secure.phabricator.com/D10274

+13 -2
+2 -1
src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
··· 72 72 'uri' => $file->getBestURI(), 73 73 'phid' => $macro->getPHID(), 74 74 'authorPHID' => $file->getAuthorPHID(), 75 - 'dateCreated' => $file->getDateCreated(), 75 + 'dateCreated' => $file->getDateCreated(), 76 + 'filePHID' => $file->getPHID(), 76 77 ); 77 78 } 78 79
+11 -1
src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php
··· 82 82 } 83 83 84 84 public function rasterize($macro, $size, $aspect) { 85 - $image = HTTPSFuture::loadContent($macro['uri']); 85 + try { 86 + $image = $this->getConduit()->callMethodSynchronous( 87 + 'file.download', 88 + array( 89 + 'phid' => $macro['filePHID'], 90 + )); 91 + $image = base64_decode($image); 92 + } catch (Exception $ex) { 93 + return false; 94 + } 95 + 86 96 if (!$image) { 87 97 return false; 88 98 }