Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93550373
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
Fri, Nov 29, 16:06
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 16:06 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22664010
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
();
$actor
=
$this
->
getActor
();
$xactions
=
array
();
if
(
$is_new
)
{
$xactions
[]
=
$this
->
newTransaction
()
->
setTransactionType
(
ManiphestTaskTitleTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
nonempty
(
$mail
->
getSubject
(),
pht
(
'Untitled Task'
)));
$xactions
[]
=
$this
->
newTransaction
()
->
setTransactionType
(
ManiphestTaskDescriptionTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
$body
);
$actor_phid
=
$actor
->
getPHID
();
if
(
$actor_phid
)
{
$xactions
[]
=
$this
->
newTransaction
()
->
setTransactionType
(
PhabricatorTransactions
::
TYPE_SUBSCRIBERS
)
->
setNewValue
(
array
(
'+'
=>
array
(
$actor_phid
),
));
}
}
return
$xactions
;
}
}
Event Timeline
Log In to Comment