+ // Comments can be deleted by the thread owner or comment owner
+ if (($item['id'] != $item['parent']) && ($item['contact-id'] != $importer["id"])) {
+ $condition = ['id' => $item['parent'], 'contact-id' => $importer["id"]];
+ if (!dba::exists('item', $condition)) {
+ logger("Item with uri " . $uri . " wasn't found or mustn't be deleted by contact " . $importer["id"] . " - ignoring deletion.", LOGGER_DEBUG);
+ return;
+ }
+ }
+