From 64cad0a041e44940f75bf351fc3755b3202f9029 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Fri, 30 Jun 2017 00:50:57 -0700 Subject: duplicated posts after conversation fetch --- include/feedutils.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/feedutils.php b/include/feedutils.php index 27f189119..b64a98a7f 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1122,6 +1122,17 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { } } } + + // the conversation parent might just be the post we are trying to import. + // check existence again in case it was just delivered. + + $r = q("SELECT id FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", + dbesc($datarray['mid']), + intval($importer['channel_id']) + ); + if($r) { + continue; + } } if(! $pmid) { -- cgit v1.2.3