@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 PasteMailReceiver extends PhabricatorObjectMailReceiver {
4
5 public function isEnabled() {
6 return PhabricatorApplication::isClassInstalled(
7 PhabricatorPasteApplication::class);
8 }
9
10 protected function getObjectPattern() {
11 return 'P[1-9]\d*';
12 }
13
14 protected function loadObject($pattern, PhabricatorUser $viewer) {
15 $id = (int)substr($pattern, 1);
16
17 return id(new PhabricatorPasteQuery())
18 ->setViewer($viewer)
19 ->withIDs(array($id))
20 ->executeOne();
21 }
22
23 protected function getTransactionReplyHandler() {
24 return new PasteReplyHandler();
25 }
26
27}