]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Processor.php
Merge pull request #7570 from nupplaphil/bug/friendica-7298
[friendica.git] / src / Protocol / ActivityPub / Processor.php
index dadadecde9af1c97789404cce9d51292a2f64df6..7639d0f2a325d97ee6dc3ea6a9f2fb48a4f0d6b4 100644 (file)
@@ -111,7 +111,11 @@ class Processor
                                        continue;
                                }
 
-                               $item['body'] .= "\n[img]" . $attach['url'] . '[/img]';
+                               if (empty($attach['name'])) {
+                                       $item['body'] .= "\n[img]" . $attach['url'] . '[/img]';
+                               } else {
+                                       $item['body'] .= "\n[img=" . $attach['url'] . ']' . $attach['name'] . '[/img]';
+                               }
                        } else {
                                if (!empty($item["attach"])) {
                                        $item["attach"] .= ',';
@@ -411,9 +415,7 @@ class Processor
 
                        if ($isForum) {
                                $item['contact-id'] = Contact::getIdForURL($activity['actor'], $receiver, true);
-                       }
-
-                       if (empty($item['contact-id'])) {
+                       } else {
                                $item['contact-id'] = Contact::getIdForURL($activity['author'], $receiver, true);
                        }