Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99193781
ManiphestReplyHandler.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
Wed, Jan 22, 05:48
Size
978 B
Mime Type
text/x-php
Expires
Fri, Jan 24, 05:48 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
23732238
Attached To
rPH Phabricator
ManiphestReplyHandler.php
View Options
<?php
final
class
ManiphestReplyHandler
extends
PhabricatorApplicationTransactionReplyHandler
{
public
function
validateMailReceiver
(
$mail_receiver
)
{
if
(!(
$mail_receiver
instanceof
ManiphestTask
))
{
throw
new
Exception
(
pht
(
'Mail receiver is not a %s!'
,
'ManiphestTask'
));
}
}
public
function
getObjectPrefix
()
{
return
'T'
;
}
protected
function
didReceiveMail
(
PhabricatorMetaMTAReceivedMail
$mail
,
$body
)
{
$object
=
$this
->
getMailReceiver
();
$is_new
=
!
$object
->
getID
();
$xactions
=
array
();
if
(
$is_new
)
{
$xactions
[]
=
$object
->
getApplicationTransactionTemplate
()
->
setTransactionType
(
ManiphestTransaction
::
TYPE_TITLE
)
->
setNewValue
(
nonempty
(
$mail
->
getSubject
(),
pht
(
'Untitled Task'
)));
$xactions
[]
=
$object
->
getApplicationTransactionTemplate
()
->
setTransactionType
(
ManiphestTransaction
::
TYPE_DESCRIPTION
)
->
setNewValue
(
$body
);
}
return
$xactions
;
}
}
Event Timeline
Log In to Comment