]> git.mxchange.org Git - friendica.git/commitdiff
Changed function name
authorMichael <heluecht@pirati.ca>
Tue, 25 Oct 2022 12:40:22 +0000 (12:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 25 Oct 2022 12:40:22 +0000 (12:40 +0000)
src/Protocol/Diaspora.php
src/Worker/Delivery.php

index b3108c8ff321abdf2c868cf2821f07925f767d96..389bbc55d27fb1116414d6b51cbdd0f1f36da443 100644 (file)
@@ -3171,15 +3171,15 @@ class Diaspora
        }
 
        /**
-        * Checks a message body if it is a reshare
+        * Fetch reshare details
         *
         * @param array $item The message body that is to be check
         *
-        * @return array Reshare details or "false" if no reshare
+        * @return array Reshare details (empty if the item is no reshare)
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function isReshare(array $item): array
+       public static function getReshareDetails(array $item): array
        {
                $reshared = Item::getShareArray($item);
                if (empty($reshared)) {
@@ -3298,7 +3298,7 @@ class Diaspora
                $edited = DateTimeFormat::utc($item['edited'] ?? $item['created'], DateTimeFormat::ATOM);
 
                // Detect a share element and do a reshare
-               if (($item['private'] != Item::PRIVATE) && ($ret = self::isReshare($item))) {
+               if (($item['private'] != Item::PRIVATE) && ($ret = self::getReshareDetails($item))) {
                        $message = [
                                'author'                => $myaddr,
                                'guid'                  => $item['guid'],
index f51f5f205bd10ef808d69fbbe29d1f070a9a4cc2..d90b80e6fdf63cdf8edd35a788143075c87f9905 100644 (file)
@@ -274,7 +274,7 @@ class Delivery
        private static function deliverDFRN(string $cmd, array $contact, array $owner, array $items, array $target_item, bool $public_message, bool $top_level, bool $followup, int $server_protocol = null)
        {
                // Transmit Diaspora reshares via Diaspora if the Friendica contact support Diaspora
-               if (Diaspora::isReshare($target_item ?? []) && !empty(FContact::getByURL($contact['addr'], false))) {
+               if (Diaspora::getReshareDetails($target_item ?? []) && !empty(FContact::getByURL($contact['addr'], false))) {
                        Logger::info('Reshare will be transmitted via Diaspora', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]);
                        self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
                        return;