From: Art4 Date: Mon, 16 Dec 2024 10:06:45 +0000 (+0100) Subject: Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c6c29b29b1b8a9bff684045552ae77295288e972;p=friendica.git Merge branch '2024.09-rc' into merge-2024.09-rc-into-develop --- c6c29b29b1b8a9bff684045552ae77295288e972 diff --cc src/Object/Image.php index 43b6d91607,08ebe4f458..0aad761341 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@@ -765,12 -765,13 +765,12 @@@ class Imag /** * Create a blurhash out of a given image string * - * @param string $img_str * @return string */ - public function getBlurHash(): string + public function getBlurHash(string $img_str = ''): string { - $image = New Image($this->asString(), $this->getType(), $this->filename, false); + $image = new Image($img_str ?: $this->asString(), $this->getType(), $this->filename, false); - if (empty($image) || !$this->isValid()) { + if (!$this->isValid()) { return ''; } diff --cc src/Protocol/ATProtocol/Actor.php index 18b5fc957d,a45bdd2978..2b5cab3fbd --- a/src/Protocol/ATProtocol/Actor.php +++ b/src/Protocol/ATProtocol/Actor.php @@@ -174,26 -195,29 +195,26 @@@ class Acto return $contact; } - if (empty($contact)) { - $fields = [ - 'uid' => $contact_uid, - 'network' => Protocol::BLUESKY, - 'priority' => 1, - 'writable' => true, - 'blocked' => false, - 'readonly' => false, - 'pending' => false, - 'url' => $did, - 'nurl' => $did, - 'alias' => ATProtocol::WEB . '/profile/' . $did, - 'name' => $did, - 'nick' => $did, - 'addr' => $did, - 'rel' => Contact::NOTHING, - ]; - $cid = Contact::insert($fields); - } else { - $cid = $contact['id']; - } + $fields = [ + 'uid' => $contact_uid, + 'network' => Protocol::BLUESKY, + 'priority' => 1, + 'writable' => true, + 'blocked' => false, + 'readonly' => false, + 'pending' => false, + 'url' => $did, + 'nurl' => $did, + 'alias' => ATProtocol::WEB . '/profile/' . $did, + 'name' => $did, + 'nick' => $did, + 'addr' => $did, + 'rel' => Contact::NOTHING, + ]; + + $cid = Contact::insert($fields); - $this->updateContactByDID($did); + $this->updateContactByDID($did, $contact_uid); return Contact::getById($cid); }