1
1
Fork 0

Avoid duplicates with feeds and "remote self"

This commit is contained in:
Michael 2017-04-08 08:12:14 +00:00
commit 8786bcdf0a
2 changed files with 13 additions and 6 deletions

View file

@ -407,10 +407,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
// We have to avoid duplicates. So we create the GUID in form of a hash of the plink or uri.
// In difference to the call to "uri_to_guid" several lines below we add the hash of our own host.
// This is done because our host is the original creator of the post.
if (isset($arr['plink'])) {
$arr['guid'] = uri_to_guid($arr['plink'], $a->get_hostname());
} elseif (isset($arr['uri'])) {
$arr['guid'] = uri_to_guid($arr['uri'], $a->get_hostname());
if (!isset($arr['guid'])) {
if (isset($arr['plink'])) {
$arr['guid'] = uri_to_guid($arr['plink'], $a->get_hostname());
} elseif (isset($arr['uri'])) {
$arr['guid'] = uri_to_guid($arr['uri'], $a->get_hostname());
}
}
}