X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDFRN.php;h=72ab89d925992ac04f2e37b2f4ed466dc6fc243e;hb=4d35e228c41a1fc6a6de9f50b8ec5c5bb45a9c2d;hp=f979d6b00369aea49346e1d082e8945fdf64cd1f;hpb=d6af9515ba13bf6350fd3a2714e44e0d2765a121;p=friendica.git diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index f979d6b003..72ab89d925 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2414,8 +2414,7 @@ class DFRN $item["edited"] = $xpath->query("atom:updated/text()", $entry)->item(0)->nodeValue; - $current = dba::selectFirst('item', - ['id', 'uid', 'edited', 'body'], + $current = Item::selectFirst(['id', 'uid', 'edited', 'body'], ['uri' => $item["uri"], 'uid' => $importer["importer_uid"]] ); // Is there an existing item? @@ -2747,13 +2746,18 @@ class DFRN return false; } - $condition = ["`uri` = ? AND `uid` = ? AND NOT `file` LIKE '%[%'", $uri, $importer["importer_uid"]]; - $item = dba::selectFirst('item', ['id', 'parent', 'contact-id'], $condition); + $condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]]; + $item = Item::selectFirst(['id', 'parent', 'contact-id', 'file'], $condition); if (!DBM::is_result($item)) { logger("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.", LOGGER_DEBUG); return; } + if (strstr($item['file'], '[')) { + logger("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " is filed. So it won't be deleted.", LOGGER_DEBUG); + return; + } + // When it is a starting post it has to belong to the person that wants to delete it if (($item['id'] == $item['parent']) && ($item['contact-id'] != $importer["id"])) { logger("Item with uri " . $uri . " don't belong to contact " . $importer["id"] . " - ignoring deletion.", LOGGER_DEBUG);