mirror of
https://github.com/friendica/friendica
synced 2024-12-23 08:40:16 +00:00
Merge pull request #1949 from annando/1510-feed-duplicates
Bugfix: Feeds weren't imported if a post with the same URI existed.
This commit is contained in:
commit
0104c33d98
2 changed files with 5 additions and 4 deletions
|
@ -201,8 +201,8 @@ function feed_import($xml,$importer,&$contact, &$hub) {
|
||||||
|
|
||||||
//$item["object"] = $xml;
|
//$item["object"] = $xml;
|
||||||
|
|
||||||
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s'",
|
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `uri` = '%s' AND `network` = '%s'",
|
||||||
intval($importer["uid"]), dbesc($item["uri"]));
|
intval($importer["uid"]), dbesc($item["uri"]), dbesc(NETWORK_FEED));
|
||||||
if ($r) {
|
if ($r) {
|
||||||
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
|
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$r[0]["id"], LOGGER_DEBUG);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1489,9 +1489,10 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
||||||
$arr = $unescaped;
|
$arr = $unescaped;
|
||||||
|
|
||||||
// find the item we just created
|
// find the item we just created
|
||||||
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d ORDER BY `id` ASC ",
|
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d AND `network` = '%s' ORDER BY `id` ASC ",
|
||||||
dbesc($arr['uri']),
|
dbesc($arr['uri']),
|
||||||
intval($arr['uid'])
|
intval($arr['uid']),
|
||||||
|
dbesc($arr['network'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
|
Loading…
Reference in a new issue