]> git.mxchange.org Git - friendica.git/commitdiff
Logging and check for network added
authorMichael <heluecht@pirati.ca>
Tue, 28 Jul 2020 06:42:12 +0000 (06:42 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 28 Jul 2020 06:42:12 +0000 (06:42 +0000)
src/Model/Item.php

index a4ba41a69586fd66b9e78d5fc567b90531d044f4..6567e5e2605d9c4f530c2fb1a44d1981c01a9733 100644 (file)
@@ -2175,7 +2175,12 @@ class Item
        public static function storeForUserByUriId(int $uri_id, int $uid)
        {
                $item = self::selectFirst(self::ITEM_FIELDLIST, ['uri-id' => $uri_id, 'uid' => 0]);
-               if (empty($item) || ($item['private'] != self::PRIVATE)) {
+               if (!DBA::isResult($item)) {
+                       return 0;
+               }
+
+               if (($item['private'] == self::PRIVATE) || !in_array($item['network'], Protocol::FEDERATED)) {
+                       Logger::notice('Item is private or not from a federated network. It will not be stored for the user.', ['uri-id' => $uri_id, 'uid' => $uid, 'private' => $item['private'], 'network' => $item['network']]);
                        return 0;
                }