From: Michael Date: Tue, 14 Apr 2020 17:18:48 +0000 (+0000) Subject: Don't use "sensitive" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=010491e0b009db7f203848848f3b9cda51c5d3c5;p=friendica.git Don't use "sensitive" --- diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index ef7fb6f4e9..89cff65368 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -170,12 +170,16 @@ class Processor */ public static function updateItem($activity) { - $item = Item::selectFirst(['uri', 'thr-parent', 'gravity'], ['uri' => $activity['id']]); + $item = Item::selectFirst(['uri', 'uri-id', 'guid', 'thr-parent', 'gravity'], ['uri' => $activity['id']]); if (!DBA::isResult($item)) { Logger::warning('Unknown item', ['uri' => $activity['id']]); return; } + if (empty($item['uri-id'])) { + $item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]); + } + $item['changed'] = DateTimeFormat::utcNow(); $item['edited'] = DateTimeFormat::utc($activity['updated']); @@ -404,7 +408,7 @@ class Processor $item['tag'] = self::constructTagString($activity['tags'], $activity['sensitive']); - self::storeTags($item['uri-id'], $activity['tags'], $activity['sensitive']); + self::storeTags($item['uri-id'], $activity['tags']); $item['location'] = $activity['location']; @@ -576,7 +580,7 @@ class Processor } } - private static function storeTags(int $uriid, array $tags = null, $sensitive = false) + private static function storeTags(int $uriid, array $tags = null) { // Make sure to delete all existing tags (can happen when called via the update functionality) DBA::delete('tag', ['uri-id' => $uriid]); @@ -619,7 +623,7 @@ class Processor DBA::insert('tag', $fields, true); - Logger::info('Stored tag/mention', ['uriid' => $uriid, 'tag' => $tag, 'sensitive' => $sensitive, 'fields' => $fields]); + Logger::info('Stored tag/mention', ['uriid' => $uriid, 'tag' => $tag, 'fields' => $fields]); } }