X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=f3b27ac80f8600251eaf233cbbb24c109784d8ed;hb=a55057d97434c92cf12233869496e12b620ff3c9;hp=00be8aecf770c33f402ebc9ec56819a57df8c566;hpb=72c198990e3d6dd23628ad15600b2089882e03c4;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index 00be8aecf7..f3b27ac80f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1116,6 +1116,7 @@ class Item */ public static function deleteById($item_id, $priority = PRIORITY_HIGH) { + Logger::notice('Delete item by id', ['id' => $item_id, 'callstack' => System::callstack()]); // locate item to be deleted $fields = ['id', 'uri', 'uid', 'parent', 'parent-uri', 'origin', 'deleted', 'file', 'resource-id', 'event-id', 'attach', @@ -1938,7 +1939,7 @@ class Item if ($entries > 1) { // There are duplicates. We delete our just created entry. - Logger::log('Duplicated post occurred. uri = ' . $item['uri'] . ' uid = ' . $item['uid']); + Logger::notice('Delete duplicated item', ['id' => $current_post, 'uri' => $item['uri'], 'uid' => $item['uid']]); // Yes, we could do a rollback here - but we are having many users with MyISAM. DBA::delete('item', ['id' => $current_post]); @@ -2721,9 +2722,7 @@ class Item if (!$mention) { if (($community_page || $prvgroup) && !$item['wall'] && !$item['origin'] && ($item['id'] == $item['parent'])) { - // mmh.. no mention.. community page or private group... no wall.. no origin.. top-post (not a comment) - // delete it! - Logger::log("no-mention top-level post to community or private group. delete."); + Logger::notice('Delete private group/communiy top-level item without mention', ['id' => $item_id]); DBA::delete('item', ['id' => $item_id]); return true; } @@ -3142,7 +3141,7 @@ class Item * array $arr * 'post_id' => ID of posted item */ - public static function performLike($item_id, $verb) + public static function performActivity($item_id, $verb) { if (!Session::isAuthenticated()) { return false; @@ -3169,6 +3168,10 @@ class Item case 'unattendmaybe': $activity = Activity::ATTENDMAYBE; break; + case 'follow': + case 'unfollow': + $activity = Activity::FOLLOW; + break; default: Logger::log('like: unknown verb ' . $verb . ' for item ' . $item_id); return false; @@ -3371,7 +3374,7 @@ class Item $condition = ["`uri` = ? AND NOT `deleted` AND NOT (`uid` IN (?, 0))", $itemuri, $item["uid"]]; if (!self::exists($condition)) { DBA::delete('item', ['uri' => $itemuri, 'uid' => 0]); - Logger::log("deleteThread: Deleted shadow for item ".$itemuri, Logger::DEBUG); + Logger::debug('Deleted shadow item', ['id' => $itemid, 'uri' => $itemuri]); } } }