Replace legacy file/category handling

This commit is contained in:
Michael 2021-01-21 07:16:41 +00:00
parent 0668b2dfd5
commit d2ea3eabfb
14 changed files with 103 additions and 253 deletions

View file

@ -2526,7 +2526,7 @@ class Diaspora
}
// Fetch items that are about to be deleted
$fields = ['uid', 'id', 'parent', 'author-link', 'file'];
$fields = ['uid', 'id', 'parent', 'author-link', 'uri-id'];
// When we receive a public retraction, we delete every item that we find.
if ($importer['uid'] == 0) {
@ -2542,7 +2542,7 @@ class Diaspora
}
while ($item = Post::fetch($r)) {
if (strstr($item['file'], '[')) {
if (DBA::exists('post-category', ['uri-id' => $item['uri-id'], 'uid' => $item['uid'], 'type' => Post\Category::FILE])) {
Logger::log("Target guid " . $target_guid . " for user " . $item['uid'] . " is filed. So it won't be deleted.", Logger::DEBUG);
continue;
}