Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892378
ManiphestReplyHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
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
Sun, Jan 19, 16:42 (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126594
Default Alt Text
ManiphestReplyHandler.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment