Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101264936
PasteReplyHandler.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, Feb 7, 07:44
Size
863 B
Mime Type
text/x-php
Expires
Sun, Feb 9, 07:44 (2 d)
Engine
blob
Format
Raw Data
Handle
24124217
Attached To
rPH Phabricator
PasteReplyHandler.php
View Options
<?php
final
class
PasteReplyHandler
extends
PhabricatorApplicationTransactionReplyHandler
{
public
function
validateMailReceiver
(
$mail_receiver
)
{
if
(!(
$mail_receiver
instanceof
PhabricatorPaste
))
{
throw
new
Exception
(
'Mail receiver is not a PhabricatorPaste.'
);
}
}
public
function
getObjectPrefix
()
{
return
'P'
;
}
protected
function
processMailCommands
(
array
$commands
)
{
$actor
=
$this
->
getActor
();
$xactions
=
array
();
foreach
(
$commands
as
$command
)
{
switch
(
head
(
$command
))
{
case
'unsubscribe'
:
$xaction
=
id
(
new
PhabricatorPasteTransaction
())
->
setTransactionType
(
PhabricatorTransactions
::
TYPE_SUBSCRIBERS
)
->
setNewValue
(
array
(
'-'
=>
array
(
$actor
->
getPHID
())));
$xactions
[]
=
$xaction
;
break
;
}
}
return
$xactions
;
}
}
Event Timeline
Log In to Comment