mirror of
https://github.com/friendica/friendica
synced 2025-04-27 08:30:10 +00:00
Fix for not being able to delete items
This commit is contained in:
parent
e9dbf55400
commit
bdbc51229a
12 changed files with 65 additions and 25 deletions
|
@ -1049,7 +1049,7 @@ class Contact extends BaseObject
|
|||
|
||||
$contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id');
|
||||
|
||||
$r = q(item_query() . " AND `item`.`" . $contact . "` = %d AND " . $sql .
|
||||
$r = q(item_query(local_user()) . " AND `item`.`" . $contact . "` = %d AND " . $sql .
|
||||
" AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d",
|
||||
intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST),
|
||||
intval($a->pager['start']), intval($a->pager['itemspage'])
|
||||
|
|
|
@ -201,8 +201,16 @@ class Item extends BaseObject
|
|||
|
||||
// send the notification upstream/downstream
|
||||
Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", intval($item['id']));
|
||||
} elseif ($item['uid'] != 0) {
|
||||
|
||||
// When we delete just our local user copy of an item, we have to set an marker to hide it
|
||||
$global_item = dba::selectFirst('item', ['id'], ['uri' => $item['uri'], 'uid' => 0, 'deleted' => false]);
|
||||
if (DBM::is_result($global_item)) {
|
||||
dba::update('user-item', ['hidden' => true], ['iid' => $global_item['id'], 'uid' => $item['uid']], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
logger('Item with ID ' . $item_id . " has been deleted.", LOGGER_DEBUG);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue