Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120605164
ManiphestAssignEmailCommand.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, Jul 5, 13:34
Size
960 B
Mime Type
text/x-php
Expires
Mon, Jul 7, 13:34 (2 d)
Engine
blob
Format
Raw Data
Handle
27204900
Attached To
rPH Phabricator
ManiphestAssignEmailCommand.php
View Options
<?php
final
class
ManiphestAssignEmailCommand
extends
ManiphestEmailCommand
{
public
function
getCommand
()
{
return
'assign'
;
}
public
function
buildTransactions
(
PhabricatorUser
$viewer
,
PhabricatorApplicationTransactionInterface
$object
,
PhabricatorMetaMTAReceivedMail
$mail
,
$command
,
array
$argv
)
{
$xactions
=
array
();
$assign_to
=
head
(
$argv
);
if
(
$assign_to
)
{
$assign_user
=
id
(
new
PhabricatorPeopleQuery
())
->
setViewer
(
$viewer
)
->
withUsernames
(
array
(
$assign_to
))
->
executeOne
();
if
(
$assign_user
)
{
$assign_phid
=
$assign_user
->
getPHID
();
}
}
// Treat bad "!assign" like "!claim".
if
(!
$assign_phid
)
{
$assign_phid
=
$viewer
->
getPHID
();
}
$xactions
[]
=
$object
->
getApplicationTransactionTemplate
()
->
setTransactionType
(
ManiphestTransaction
::
TYPE_OWNER
)
->
setNewValue
(
$assign_phid
);
return
$xactions
;
}
}
Event Timeline
Log In to Comment