Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112711261
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
Mon, May 12, 12:02
Size
960 B
Mime Type
text/x-php
Expires
Wed, May 14, 12:02 (2 d)
Engine
blob
Format
Raw Data
Handle
26129985
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