Avoid storing an icid value when iaid is stored/Fix item retraction

This commit is contained in:
Michael 2018-07-07 16:38:01 +00:00
parent 575662c2d7
commit d6af9515ba
2 changed files with 6 additions and 3 deletions

View file

@ -2709,10 +2709,11 @@ class Diaspora
// When we receive a public retraction, we delete every item that we find.
if ($importer['uid'] == 0) {
$condition = ["`guid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid];
$condition = ['guid' => $target_guid, 'deleted' => false];
} else {
$condition = ["`guid` = ? AND `uid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid, $importer['uid']];
$condition = ['guid' => $target_guid, 'deleted' => false, 'uid' => $importer['uid']];
}
$r = Item::select($fields, $condition);
if (!DBM::is_result($r)) {
logger("Target guid ".$target_guid." was not found on this system for user ".$importer['uid'].".");