]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlist.php
Merge branch 'profile' into 'nightly'
[quix0rs-gnu-social.git] / lib / attachmentlist.php
index dcae917be36c17c8b0180d9d6982203601ba3016..0ce19b0b1ed38c66859d34113a18932ba269ce4d 100644 (file)
@@ -76,8 +76,8 @@ class AttachmentList extends Widget
     {
        $attachments = $this->notice->attachments();
         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]);
             }
         }
@@ -85,6 +85,12 @@ class AttachmentList extends Widget
             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) {