mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
Replace legacy file/category handling
This commit is contained in:
parent
0668b2dfd5
commit
d2ea3eabfb
14 changed files with 103 additions and 253 deletions
|
@ -2508,14 +2508,14 @@ class DFRN
|
|||
}
|
||||
|
||||
$condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]];
|
||||
$item = Post::selectFirst(['id', 'parent', 'contact-id', 'file', 'deleted', 'gravity'], $condition);
|
||||
$item = Post::selectFirst(['id', 'parent', 'contact-id', 'uri-id', 'deleted', 'gravity'], $condition);
|
||||
if (!DBA::isResult($item)) {
|
||||
Logger::log("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.", Logger::DEBUG);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strstr($item['file'], '[')) {
|
||||
Logger::log("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " is filed. So it won't be deleted.", Logger::DEBUG);
|
||||
if (DBA::exists('post-category', ['uri-id' => $item['uri-id'], 'uid' => $importer['importer_uid'], 'type' => Post\Category::FILE])) {
|
||||
Logger::notice("Item is filed. It won't be deleted.", ['uri' => $uri, 'uri-id' => $item['uri_id'], 'uid' => $importer["importer_uid"]]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue