Don't create the parent during a deletion
This commit is contained in:
parent
f9994548c1
commit
1f1697222b
2 changed files with 17 additions and 9 deletions
|
@ -2705,8 +2705,12 @@ class DFRN
|
||||||
}
|
}
|
||||||
|
|
||||||
$deletions = $xpath->query("/atom:feed/at:deleted-entry");
|
$deletions = $xpath->query("/atom:feed/at:deleted-entry");
|
||||||
foreach ($deletions as $deletion) {
|
if (!empty($deletions)) {
|
||||||
self::processDeletion($xpath, $deletion, $importer);
|
foreach ($deletions as $deletion) {
|
||||||
|
self::processDeletion($xpath, $deletion, $importer);
|
||||||
|
}
|
||||||
|
Logger::notice('Deletions had been processed');
|
||||||
|
return 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$sort_by_date) {
|
if (!$sort_by_date) {
|
||||||
|
|
|
@ -296,13 +296,17 @@ class Delivery
|
||||||
$msgitems = [$target_item];
|
$msgitems = [$target_item];
|
||||||
$atom = DFRN::entries($msgitems, $owner);
|
$atom = DFRN::entries($msgitems, $owner);
|
||||||
} else {
|
} else {
|
||||||
$msgitems = [];
|
if ($target_item['deleted']) {
|
||||||
foreach ($items as $item) {
|
$msgitems = [$target_item];
|
||||||
// Only add the parent when we don't delete other items.
|
} else {
|
||||||
if (($target_item['id'] == $item['id']) || ($cmd != self::DELETION)) {
|
$msgitems = [];
|
||||||
$item["entry:comment-allow"] = true;
|
foreach ($items as $item) {
|
||||||
$item["entry:cid"] = ($top_level ? $contact['id'] : 0);
|
// Only add the parent when we don't delete other items.
|
||||||
$msgitems[] = $item;
|
if (($target_item['id'] == $item['id']) || ($cmd != self::DELETION)) {
|
||||||
|
$item["entry:comment-allow"] = true;
|
||||||
|
$item["entry:cid"] = ($top_level ? $contact['id'] : 0);
|
||||||
|
$msgitems[] = $item;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$atom = DFRN::entries($msgitems, $owner);
|
$atom = DFRN::entries($msgitems, $owner);
|
||||||
|
|
Loading…
Reference in a new issue