Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96580922
LegalpadMockMailReceiver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 28, 12:03
Size
969 B
Mime Type
text/x-php
Expires
Mon, Dec 30, 12:03 (1 d, 8 h)
Engine
blob
Format
Raw Data
Handle
23191032
Attached To
rPH Phabricator
LegalpadMockMailReceiver.php
View Options
<?php
final
class
LegalpadMockMailReceiver
extends
PhabricatorObjectMailReceiver
{
public
function
isEnabled
()
{
$app_class
=
'PhabricatorLegalpadApplication'
;
return
PhabricatorApplication
::
isClassInstalled
(
$app_class
);
}
protected
function
getObjectPattern
()
{
return
'L[1-9]
\d
*'
;
}
protected
function
loadObject
(
$pattern
,
PhabricatorUser
$viewer
)
{
$id
=
(
int
)
trim
(
$pattern
,
'L'
);
return
id
(
new
LegalpadDocumentQuery
())
->
setViewer
(
$viewer
)
->
withIDs
(
array
(
$id
))
->
needDocumentBodies
(
true
)
->
executeOne
();
}
protected
function
processReceivedObjectMail
(
PhabricatorMetaMTAReceivedMail
$mail
,
PhabricatorLiskDAO
$object
,
PhabricatorUser
$sender
)
{
$handler
=
id
(
new
LegalpadReplyHandler
())
->
setMailReceiver
(
$object
)
->
setActor
(
$sender
)
->
setExcludeMailRecipientPHIDs
(
$mail
->
loadExcludeMailRecipientPHIDs
());
return
$handler
->
processEmail
(
$mail
);
}
}
Event Timeline
Log In to Comment