]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Raw content is now stored with announce messages as well
[friendica.git] / src / Model / Item.php
index 71e37bd18ec3fdbede2f7a562b3c265bcd91440b..eac3b7028623dac5bdee844b471eb1721c43b793 100644 (file)
@@ -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;
                        }
@@ -3371,7 +3370,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]);
                        }
                }
        }
@@ -3634,7 +3633,7 @@ class Item
                        $title .= ' ' . $mtch[2] . ' ' . DI::l10n()->t('bytes');
 
                        $icon = '<div class="attachtype icon s22 type-' . $filetype . ' subtype-' . $filesubtype . '"></div>';
-                       $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
+                       $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" rel="noopener noreferrer" >' . $icon . '</a>';
                }
 
                if ($as != '') {