]> git.mxchange.org Git - friendica.git/commitdiff
Some more warnings removed
authorMichael <heluecht@pirati.ca>
Thu, 31 Oct 2019 07:33:25 +0000 (07:33 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 31 Oct 2019 07:33:25 +0000 (07:33 +0000)
src/Model/GContact.php
src/Protocol/Diaspora.php
src/Worker/Notifier.php

index 19d27109ea856c779a83904c2af0667342d01b4a..493d67f024a366f6f858cbdba98fa20ccaf70912 100644 (file)
@@ -809,14 +809,11 @@ class GContact
                        return;
                }
 
-               // When the profile doesn't have got a feed, then we exit here
-               if (empty($data['poll'])) {
-                       return;
-               }
-
-               if ($data['network'] == Protocol::ACTIVITYPUB) {
+               if (!empty($data['outbox'])) {
+                       self::updateFromOutbox($data['outbox'], $data);
+               } elseif (!empty($data['poll']) && ($data['network'] == Protocol::ACTIVITYPUB)) {
                        self::updateFromOutbox($data['poll'], $data);
-               } else {
+               } elseif (!empty($data['poll'])) {
                        self::updateFromFeed($data);
                }
        }
@@ -885,10 +882,17 @@ class GContact
                }
 
                $last_updated = '';
-
                foreach ($items as $activity) {
-                       if ($last_updated < $activity['published']) {
-                               $last_updated = $activity['published'];
+                       if (!empty($activity['published'])) {
+                               $published =  DateTimeFormat::utc($activity['published']);
+                       } elseif (!empty($activity['object']['published'])) {
+                               $published =  DateTimeFormat::utc($activity['object']['published']);
+                       } else {
+                               continue;
+                       }
+
+                       if ($last_updated < $published) {
+                               $last_updated = $published;
                        }
                }
 
index dc02366cb1df34f5ae95b7d5ddd53d808eb1af9d..3b283504ccadc8f5f665657251e85f0789f741b0 100644 (file)
@@ -176,7 +176,7 @@ class Diaspora
         * @return array with the contact
         * @throws \Exception
         */
-       private static function getRelayContact(string $server_url, array $fields = ['batch', 'id', 'name', 'network', 'protocol', 'archive', 'blocked'])
+       private static function getRelayContact(string $server_url, array $fields = ['batch', 'id', 'url', 'name', 'network', 'protocol', 'archive', 'blocked'])
        {
                // Fetch the relay contact
                $condition = ['uid' => 0, 'nurl' => Strings::normaliseLink($server_url),
@@ -250,7 +250,7 @@ class Diaspora
         */
        public static function participantsForThread($thread, array $contacts)
        {
-               $r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`name`, `contact`.`network`, `contact`.`protocol`,
+               $r = DBA::p("SELECT `contact`.`batch`, `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`network`, `contact`.`protocol`,
                                `fcontact`.`batch` AS `fbatch`, `fcontact`.`network` AS `fnetwork` FROM `participation`
                                INNER JOIN `contact` ON `contact`.`id` = `participation`.`cid`
                                INNER JOIN `fcontact` ON `fcontact`.`id` = `participation`.`fid`
index 80ced8acce3d7ccec2e03e6abfc7840437b6373b..9ab07e6d4935ed997d092ab85d7f10f940d939ae 100644 (file)
@@ -404,6 +404,7 @@ class Notifier
                                        "SELECT
                                                `batch`,
                                                ANY_VALUE(`id`) AS `id`,
+                                               ANY_VALUE(`url`) AS `url`,
                                                ANY_VALUE(`name`) AS `name`,
                                                ANY_VALUE(`network`) AS `network`,
                                                ANY_VALUE(`protocol`) AS `protocol`