Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96968910
PonderMentionMail.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
Wed, Jan 1, 04:57
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 3, 04:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23301859
Attached To
rPH Phabricator
PonderMentionMail.php
View Options
<?php
final
class
PonderMentionMail
extends
PonderMail
{
public
function
__construct
(
PonderQuestion
$question
,
$target
,
PhabricatorUser
$actor
)
{
$this
->
setQuestion
(
$question
);
$this
->
setTarget
(
$target
);
$this
->
setActorHandle
(
$actor
);
}
protected
function
renderVaryPrefix
()
{
return
"[Mentioned]"
;
}
protected
function
renderBody
()
{
$question
=
$this
->
getQuestion
();
$target
=
$this
->
getTarget
();
$actor
=
$this
->
getActorName
();
$name
=
$question
->
getTitle
();
$targetkind
=
"somewhere"
;
if
(
$target
instanceof
PonderQuestion
)
{
$targetkind
=
"in a question"
;
}
else
if
(
$target
instanceof
PonderAnswer
)
{
$targetkind
=
"in an answer"
;
}
else
if
(
$target
instanceof
PonderComment
)
{
$targetkind
=
"in a comment"
;
}
$body
=
array
();
$body
[]
=
"{$actor} mentioned you {$targetkind}."
;
$body
[]
=
null
;
$content
=
$target
->
getContent
();
if
(
strlen
(
$content
))
{
$body
[]
=
$this
->
formatText
(
$content
);
$body
[]
=
null
;
}
return
implode
(
"
\n
"
,
$body
);
}
}
Event Timeline
Log In to Comment