From 6a1cbe9040d13de472f4924f4fe44ee1e2524ffc Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 6 Nov 2024 17:45:30 +0000 Subject: [PATCH] Bluesky/Tumblr: Add "connector" parcel to each incoming post --- bluesky/bluesky.php | 7 +++++-- tumblr/tumblr.php | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index af7d9ac7..4882a263 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -38,6 +38,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Conversation; use Friendica\Model\GServer; use Friendica\Model\Item; use Friendica\Model\ItemURI; @@ -1058,6 +1059,7 @@ function bluesky_process_reason(stdClass $reason, string $uri, int $uid) $item = [ 'network' => Protocol::BLUESKY, + 'protocol' => Conversation::PARCEL_CONNECTOR, 'uid' => $uid, 'wall' => false, 'uri' => $reason->by->did . '/app.bsky.feed.repost/' . $reason->indexedAt, @@ -1257,6 +1259,7 @@ function bluesky_get_header(stdClass $post, string $uri, int $uid, int $fetch_ui $contact = bluesky_get_contact($post->author, $uid, $fetch_uid); $item = [ 'network' => Protocol::BLUESKY, + 'protocol' => Conversation::PARCEL_CONNECTOR, 'uid' => $uid, 'wall' => false, 'uri' => $uri, @@ -1459,8 +1462,8 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le 'url' => $embed->playlist, 'preview' => $embed->thumbnail, 'description' => $embed->alt ?? '', - 'height' => $embed->aspectRatio->height, - 'width' => $embed->aspectRatio->width, + 'height' => $embed->aspectRatio->height ?? null, + 'width' => $embed->aspectRatio->width ?? null, ]; Post\Media::insert($media); break; diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index dd34bd41..390c3c6c 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -22,6 +22,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; +use Friendica\Model\Conversation; use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Post; @@ -31,7 +32,6 @@ use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPClient\Client\HttpClientOptions; use Friendica\Protocol\Activity; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Network; use Friendica\Util\Strings; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; @@ -850,6 +850,7 @@ function tumblr_get_header(stdClass $post, string $uri, int $uid): array $contact = tumblr_get_contact($post->blog, $uid); $item = [ 'network' => Protocol::TUMBLR, + 'protocol' => Conversation::PARCEL_CONNECTOR, 'uid' => $uid, 'wall' => false, 'uri' => $uri,