Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F567897
PonderQuestionCreateMailReceiver.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
PonderQuestionCreateMailReceiver.php
View Options
<?php
final
class
PonderQuestionCreateMailReceiver
extends
PhabricatorApplicationMailReceiver
{
protected
function
newApplication
()
{
return
new
PhabricatorPonderApplication
();
}
protected
function
processReceivedMail
(
PhabricatorMetaMTAReceivedMail
$mail
,
PhutilEmailAddress
$target
)
{
$author
=
$this
->
getAuthor
();
$title
=
$mail
->
getSubject
();
if
(!
strlen
(
$title
))
{
$title
=
pht
(
'New Question'
);
}
$xactions
=
array
();
$xactions
[]
=
id
(
new
PonderQuestionTransaction
())
->
setTransactionType
(
PonderQuestionTitleTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
$title
);
$xactions
[]
=
id
(
new
PonderQuestionTransaction
())
->
setTransactionType
(
PonderQuestionContentTransaction
::
TRANSACTIONTYPE
)
->
setNewValue
(
$mail
->
getCleanTextBody
());
$question
=
PonderQuestion
::
initializeNewQuestion
(
$author
);
$content_source
=
$mail
->
newContentSource
();
$editor
=
id
(
new
PonderQuestionEditor
())
->
setActor
(
$author
)
->
setContentSource
(
$content_source
)
->
setContinueOnNoEffect
(
true
);
$xactions
=
$editor
->
applyTransactions
(
$question
,
$xactions
);
$mail
->
setRelatedPHID
(
$question
->
getPHID
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 13, 1:06 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
121410
Default Alt Text
PonderQuestionCreateMailReceiver.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment