]> git.mxchange.org Git - friendica.git/commitdiff
Issue 9705: Perform an age check when the post isn't fetched
authorMichael <heluecht@pirati.ca>
Mon, 11 Jan 2021 20:00:51 +0000 (20:00 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 11 Jan 2021 20:00:51 +0000 (20:00 +0000)
src/Model/Item.php

index 35ab929a336c9074a9fe1f79bec5ec42160d7d84..e4266b41ee0f3cee0ec353bc81ba65f14bceeb57 100644 (file)
@@ -1698,6 +1698,12 @@ class Item
                // The contact-id should be set before "self::insert" was called - but there seems to be issues sometimes
                $item["contact-id"] = self::contactId($item);
 
+               if (!empty($item['direction']) && in_array($item['direction'], [Conversation::PUSH, Conversation::RELAY]) &&
+                       self::isTooOld($item)) {
+                       Logger::info('Item is too old', ['item' => $item]);
+                       return 0;
+               }
+
                if (!self::isValid($item)) {
                        return 0;
                }