Merge pull request #9299 from annando/avoid-duplicates

Avoid duplicate postings
This commit is contained in:
Hypolite Petovan 2020-09-27 10:10:43 -04:00 committed by GitHub
commit 2260c0957a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1834,6 +1834,11 @@ class Item
if (!in_array($item['verb'], self::ACTIVITIES)) { if (!in_array($item['verb'], self::ACTIVITIES)) {
$item['icid'] = self::insertContent($item); $item['icid'] = self::insertContent($item);
if (empty($item['icid'])) {
// This most likely happens when identical posts arrives from different sources at the same time
Logger::warning('No content stored, quitting', ['guid' => $item['guid'], 'uri-id' => $item['uri-id'], 'causer-id' => ($item['causer-id'] ?? 0), 'post-type' => $item['post-type'], 'network' => $item['network']]);
return 0;
}
} }
$body = $item['body']; $body = $item['body'];