]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Providing the uri-id to "convert" when possible
[friendica.git] / src / Protocol / DFRN.php
index 2cb83627ace2a4ba5d5ff830e375456cf486f229..9ac40c0a2dafb499175b175dba106a6d9f133c1e 100644 (file)
@@ -51,6 +51,7 @@ use Friendica\Util\Crypto;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Images;
 use Friendica\Util\Network;
+use Friendica\Util\Proxy;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
@@ -618,7 +619,8 @@ class DFRN
                XML::addElement($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
 
                $attributes = ["rel" => "photo", "type" => "image/jpeg",
-                                       "media:width" => 300, "media:height" => 300, "href" => $owner['photo']];
+                                       "media:width" => Proxy::PIXEL_SMALL, "media:height" => Proxy::PIXEL_SMALL,
+                                       "href" => Contact::getAvatarUrlForId($owner['id'], Proxy::SIZE_SMALL, $owner['updated'])];
 
                if (!$public || !$hide) {
                        $attributes["dfrn:updated"] = $picdate;
@@ -899,7 +901,7 @@ class DFRN
                        $entry->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
                }
 
-               $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']);
+               $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'] ?? '');
 
                if ($item['private'] == Item::PRIVATE) {
                        $body = Item::fixPrivatePhotos($body, $owner['uid'], $item, $cid);
@@ -916,7 +918,7 @@ class DFRN
                                $htmlbody = "[b]" . $item['title'] . "[/b]\n\n" . $htmlbody;
                        }
 
-                       $htmlbody = BBCode::convert($htmlbody, false, BBCode::OSTATUS);
+                       $htmlbody = BBCode::convert($htmlbody, false, BBCode::OSTATUS, false, $item['uri-id']);
                }
 
                $author = self::addEntryAuthor($doc, "author", $item["author-link"], $item);