@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<?php
2
3final class PholioInlineListController extends PholioController {
4
5 public function handleRequest(AphrontRequest $request) {
6 $viewer = $request->getViewer();
7 $id = $request->getURIData('id');
8
9 $image = id(new PholioImageQuery())
10 ->setViewer($viewer)
11 ->withIDs(array($id))
12 ->executeOne();
13 if (!$image) {
14 return new Aphront404Response();
15 }
16
17 $inline_comments = id(new PholioTransactionComment())->loadAllWhere(
18 'imageid = %d AND (transactionphid IS NOT NULL
19 OR (authorphid = %s AND transactionphid IS NULL))',
20 $id,
21 $viewer->getPHID());
22
23 $author_phids = mpull($inline_comments, 'getAuthorPHID');
24 $authors = $this->loadViewerHandles($author_phids);
25
26 $inlines = array();
27 foreach ($inline_comments as $inline_comment) {
28 $inlines[] = $inline_comment->toDictionary();
29 }
30
31 return id(new AphrontAjaxResponse())->setContent($inlines);
32 }
33
34}