@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 PhabricatorSubscriptionsListController
4 extends PhabricatorController {
5
6 public function shouldAllowPublic() {
7 return true;
8 }
9
10 public function handleRequest(AphrontRequest $request) {
11 $viewer = $request->getViewer();
12
13 $object = id(new PhabricatorObjectQuery())
14 ->setViewer($viewer)
15 ->withPHIDs(array($request->getURIData('phid')))
16 ->executeOne();
17 if (!$object) {
18 return new Aphront404Response();
19 }
20
21 if (!($object instanceof PhabricatorSubscribableInterface)) {
22 return new Aphront404Response();
23 }
24
25 $phid = $object->getPHID();
26
27 $handle_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID($phid);
28 $handle_phids[] = $phid;
29
30 $handles = id(new PhabricatorHandleQuery())
31 ->setViewer($viewer)
32 ->withPHIDs($handle_phids)
33 ->execute();
34 $object_handle = $handles[$phid];
35
36 $dialog = id(new SubscriptionListDialogBuilder())
37 ->setViewer($viewer)
38 ->setTitle(pht('Subscribers'))
39 ->setObjectPHID($phid)
40 ->setHandles($handles)
41 ->buildDialog();
42
43 return id(new AphrontDialogResponse())->setDialog($dialog);
44 }
45
46}