mirror of
https://github.com/friendica/friendica
synced 2025-04-26 20:30:11 +00:00
Improved check for duplicates. Improvements with reshared Diaspora items.
This commit is contained in:
parent
0c752a2190
commit
7e401ca199
2 changed files with 35 additions and 13 deletions
|
@ -1351,9 +1351,22 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
|||
dbesc($arr['uri']),
|
||||
intval($arr['uid'])
|
||||
);
|
||||
|
||||
if($r && count($r)) {
|
||||
logger('item-store: duplicate item ignored. ' . print_r($arr,true));
|
||||
logger('duplicated item with the same uri found. ' . print_r($arr,true));
|
||||
return 0;
|
||||
} else {
|
||||
// Check for an existing post with the same content. There seems to be a problem with OStatus.
|
||||
$r = q("SELECT `id` FROM `item` WHERE `body` = '%s' AND `created` = '%s' AND `contact-id` = %d AND `uid` = %d LIMIT 1",
|
||||
dbesc($arr['body']),
|
||||
dbesc($arr['created']),
|
||||
intval($arr['contact-id']),
|
||||
intval($arr['uid'])
|
||||
);
|
||||
if($r && count($r)) {
|
||||
logger('duplicated item with the same body found. ' . print_r($arr,true));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Is this item available in the global items (with uid=0)?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue