forked from GNUsocial/gnu-social
When too-long messages come in via OStatus, mark the attachment link up as a "more" link in the HTML output, marked with class="attachment more" so JS code can fold it out smartly. Text output will still include the raw link.
This commit is contained in:
parent
67f2f01c5e
commit
3a72c70b7e
@ -547,9 +547,19 @@ class Ostatus_profile extends Memcached_DataObject
|
|||||||
$shortSummary = substr($shortSummary,
|
$shortSummary = substr($shortSummary,
|
||||||
0,
|
0,
|
||||||
Notice::maxContent() - (mb_strlen($url) + 2));
|
Notice::maxContent() - (mb_strlen($url) + 2));
|
||||||
$shortSummary .= '… ' . $url;
|
$shortSummary .= '…';
|
||||||
$content = $shortSummary;
|
$content = $shortSummary . ' ' . $url;
|
||||||
$rendered = common_render_text($content);
|
|
||||||
|
// We mark up the attachment link specially for the HTML output
|
||||||
|
// so we can fold-out the full version inline.
|
||||||
|
$rendered = common_render_text($shortSummary) .
|
||||||
|
' ' .
|
||||||
|
'<a href="' .
|
||||||
|
htmlspecialchars($url) .
|
||||||
|
'" class="attachment more">' .
|
||||||
|
// TRANS: expansion link for too-long remote messages
|
||||||
|
htmlspecialchars(_m('(more)')) .
|
||||||
|
'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user