Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F568051
ManiphestReplyHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
(
PhabricatorTransactions
::
TYPE_CREATE
)
->
setNewValue
(
true
);
$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
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 1:12 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
109184
Default Alt Text
ManiphestReplyHandler.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment