X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FOStatus.php;h=3d35394b92e586164b85c24bf0341d8b0f626767;hb=ec16e7c0e6349d7080f634177ef943b446be3735;hp=80644329ff4d857fc05269ce23e10be935214316;hpb=f0c29edcde0ab15150147a3ebae40ca628197fde;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 80644329ff..3d35394b92 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -385,12 +385,14 @@ class OStatus } } - $header = []; - $header['uid'] = $importer['uid']; - $header['network'] = Protocol::OSTATUS; - $header['wall'] = 0; - $header['origin'] = 0; - $header['gravity'] = Item::GRAVITY_COMMENT; + // Initial header elements + $header = [ + 'uid' => $importer['uid'], + 'network' => Protocol::OSTATUS, + 'wall' => 0, + 'origin' => 0, + 'gravity' => Item::GRAVITY_COMMENT, + ]; if (!is_object($doc->firstChild) || empty($doc->firstChild->tagName)) { return false; @@ -496,7 +498,7 @@ class OStatus $orig_uri = $xpath->query('activity:object/atom:id', $entry)->item(0)->nodeValue; Logger::notice('Favorite', ['uri' => $orig_uri, 'item' => $item]); - $item['verb'] = Activity::LIKE; + $item['body'] = $item['verb'] = Activity::LIKE; $item['thr-parent'] = $orig_uri; $item['gravity'] = Item::GRAVITY_ACTIVITY; $item['object-type'] = Activity\ObjectType::NOTE; @@ -1515,6 +1517,7 @@ class OStatus XML::addElement($doc, $entry, 'title', html_entity_decode($title, ENT_QUOTES, 'UTF-8')); $body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item)); + $body = Post\Media::addHTMLLinkToBody($item['uri-id'], $body); if (!empty($item['title'])) { $body = '[b]' . $item['title'] . "[/b]\n\n" . $body; @@ -1708,7 +1711,7 @@ class OStatus $previous_created = $last_update; - // Don't cache when the last item was posted less then 15 minutes ago (Cache duration) + // Don't cache when the last item was posted less than 15 minutes ago (Cache duration) if ((time() - strtotime($owner['last-item'])) < 15*60) { $result = DI::cache()->get($cachekey); if (!$nocache && !is_null($result)) {