Merge pull request #9779 from annando/issue-9705

Issue 9705: Perform an age check when the post isn't fetched
This commit is contained in:
Hypolite Petovan 2021-01-11 15:10:30 -05:00 committed by GitHub
commit f20bea78f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View 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;
}