*
* @param Notice $notice stream of notices from DB_DataObject
*/
- function __construct($notice, $out=null)
+ function __construct(Notice $notice, $out=null)
{
parent::__construct($out);
$this->notice = $notice;
function show()
{
$attachments = $this->notice->attachments();
- $representable = false;
foreach ($attachments as $key=>$att) {
- // Only show attachments representable with a title
- if ($att->getTitle() === null) {
+ // Remove attachments which are not representable with neither a title nor thumbnail
+ if ($att->getTitle() === null && !$att->hasThumbnail()) {
unset($attachments[$key]);
}
}
return 0;
}
+ if ($this->notice->getProfile()->isSilenced()) {
+ // TRANS: Message for inline attachments list in notices when the author has been silenced.
+ $this->element('div', ['class'=>'error'], _('Attachments are hidden because this profile has been silenced.'));
+ return 0;
+ }
+
$this->showListStart();
foreach ($attachments as $att) {