From ed86e9ca9676be39e99c7e14b7adc1c33b630fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 21 Feb 2023 12:56:24 +0100 Subject: [PATCH 1/6] Fixed: - added check for empty file name as the export doesn't work without one: `[Error] Argument 1 passed to Friendica\Moderation\DomainPatternBlocklist::exportToFile() must be of the type string, null given, called in /var/www/.../src/Console/ServerBlock.php on line 110` --- src/Console/ServerBlock.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Console/ServerBlock.php b/src/Console/ServerBlock.php index ed9ff5dbde..4d04dcff81 100644 --- a/src/Console/ServerBlock.php +++ b/src/Console/ServerBlock.php @@ -107,6 +107,11 @@ HELP; { $filename = $this->getArgument(1); + if (empty($filename)) { + $this->out('A file name is required, e.g. ./bin/console serverblock export backup.csv'); + return 1; + } + $this->blocklist->exportToFile($filename); // Success From dffd28cf2076721c935dc000a107bbb04ef70b3a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 21 Feb 2023 09:07:19 -0500 Subject: [PATCH 2/6] Remove addon table from DB structure - It isn't used anymore in favor of a Config key --- database.sql | 56 +++++++++++++---------------------- doc/database/db_addon.md | 29 ------------------ static/dbstructure.config.php | 17 ----------- 3 files changed, 20 insertions(+), 82 deletions(-) delete mode 100644 doc/database/db_addon.md diff --git a/database.sql b/database.sql index fa11843e43..4c404356f6 100644 --- a/database.sql +++ b/database.sql @@ -340,22 +340,6 @@ CREATE TABLE IF NOT EXISTS `account-user` ( FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Remote and local accounts'; --- --- TABLE addon --- -CREATE TABLE IF NOT EXISTS `addon` ( - `id` int unsigned NOT NULL auto_increment COMMENT '', - `name` varchar(50) NOT NULL DEFAULT '' COMMENT 'addon base (file)name', - `version` varchar(50) NOT NULL DEFAULT '' COMMENT 'currently unused', - `installed` boolean NOT NULL DEFAULT '0' COMMENT 'currently always 1', - `hidden` boolean NOT NULL DEFAULT '0' COMMENT 'currently unused', - `timestamp` int unsigned NOT NULL DEFAULT 0 COMMENT 'file timestamp to check for reloads', - `plugin_admin` boolean NOT NULL DEFAULT '0' COMMENT '1 = has admin config, 0 = has no admin config', - PRIMARY KEY(`id`), - INDEX `installed_name` (`installed`,`name`), - UNIQUE INDEX `name` (`name`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='registered addons'; - -- -- TABLE apcontact -- @@ -1871,7 +1855,7 @@ CREATE TABLE IF NOT EXISTS `worker-ipc` ( -- VIEW application-view -- DROP VIEW IF EXISTS `application-view`; -CREATE VIEW `application-view` AS SELECT +CREATE VIEW `application-view` AS SELECT `application`.`id` AS `id`, `application-token`.`uid` AS `uid`, `application`.`name` AS `name`, @@ -1894,7 +1878,7 @@ CREATE VIEW `application-view` AS SELECT -- VIEW post-user-view -- DROP VIEW IF EXISTS `post-user-view`; -CREATE VIEW `post-user-view` AS SELECT +CREATE VIEW `post-user-view` AS SELECT `post-user`.`id` AS `id`, `post-user`.`id` AS `post-user-id`, `post-user`.`uid` AS `uid`, @@ -2073,7 +2057,7 @@ CREATE VIEW `post-user-view` AS SELECT -- VIEW post-thread-user-view -- DROP VIEW IF EXISTS `post-thread-user-view`; -CREATE VIEW `post-thread-user-view` AS SELECT +CREATE VIEW `post-thread-user-view` AS SELECT `post-user`.`id` AS `id`, `post-user`.`id` AS `post-user-id`, `post-thread-user`.`uid` AS `uid`, @@ -2250,7 +2234,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT -- VIEW post-view -- DROP VIEW IF EXISTS `post-view`; -CREATE VIEW `post-view` AS SELECT +CREATE VIEW `post-view` AS SELECT `item-uri`.`uri` AS `uri`, `post`.`uri-id` AS `uri-id`, `parent-item-uri`.`uri` AS `parent-uri`, @@ -2390,7 +2374,7 @@ CREATE VIEW `post-view` AS SELECT -- VIEW post-thread-view -- DROP VIEW IF EXISTS `post-thread-view`; -CREATE VIEW `post-thread-view` AS SELECT +CREATE VIEW `post-thread-view` AS SELECT `item-uri`.`uri` AS `uri`, `post-thread`.`uri-id` AS `uri-id`, `parent-item-uri`.`uri` AS `parent-uri`, @@ -2532,7 +2516,7 @@ CREATE VIEW `post-thread-view` AS SELECT -- VIEW category-view -- DROP VIEW IF EXISTS `category-view`; -CREATE VIEW `category-view` AS SELECT +CREATE VIEW `category-view` AS SELECT `post-category`.`uri-id` AS `uri-id`, `post-category`.`uid` AS `uid`, `post-category`.`type` AS `type`, @@ -2546,7 +2530,7 @@ CREATE VIEW `category-view` AS SELECT -- VIEW collection-view -- DROP VIEW IF EXISTS `collection-view`; -CREATE VIEW `collection-view` AS SELECT +CREATE VIEW `collection-view` AS SELECT `post-collection`.`uri-id` AS `uri-id`, `post-collection`.`type` AS `type`, `post-collection`.`author-id` AS `cid`, @@ -2567,7 +2551,7 @@ CREATE VIEW `collection-view` AS SELECT -- VIEW media-view -- DROP VIEW IF EXISTS `media-view`; -CREATE VIEW `media-view` AS SELECT +CREATE VIEW `media-view` AS SELECT `post-media`.`uri-id` AS `uri-id`, `post-media`.`type` AS `type`, `post`.`received` AS `received`, @@ -2585,7 +2569,7 @@ CREATE VIEW `media-view` AS SELECT -- VIEW tag-view -- DROP VIEW IF EXISTS `tag-view`; -CREATE VIEW `tag-view` AS SELECT +CREATE VIEW `tag-view` AS SELECT `post-tag`.`uri-id` AS `uri-id`, `post-tag`.`type` AS `type`, `post-tag`.`tid` AS `tid`, @@ -2601,7 +2585,7 @@ CREATE VIEW `tag-view` AS SELECT -- VIEW network-item-view -- DROP VIEW IF EXISTS `network-item-view`; -CREATE VIEW `network-item-view` AS SELECT +CREATE VIEW `network-item-view` AS SELECT `post-user`.`uri-id` AS `uri-id`, `parent-post`.`id` AS `parent`, `post-user`.`received` AS `received`, @@ -2616,7 +2600,7 @@ CREATE VIEW `network-item-view` AS SELECT `post-user`.`contact-id` AS `contact-id`, `ownercontact`.`contact-type` AS `contact-type` FROM `post-user` - STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` + STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id` LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id` @@ -2632,7 +2616,7 @@ CREATE VIEW `network-item-view` AS SELECT -- VIEW network-thread-view -- DROP VIEW IF EXISTS `network-thread-view`; -CREATE VIEW `network-thread-view` AS SELECT +CREATE VIEW `network-thread-view` AS SELECT `post-thread-user`.`uri-id` AS `uri-id`, `parent-post`.`id` AS `parent`, `post-thread-user`.`received` AS `received`, @@ -2661,7 +2645,7 @@ CREATE VIEW `network-thread-view` AS SELECT -- VIEW owner-view -- DROP VIEW IF EXISTS `owner-view`; -CREATE VIEW `owner-view` AS SELECT +CREATE VIEW `owner-view` AS SELECT `contact`.`id` AS `id`, `contact`.`uid` AS `uid`, `contact`.`created` AS `created`, @@ -2791,7 +2775,7 @@ CREATE VIEW `owner-view` AS SELECT -- VIEW account-view -- DROP VIEW IF EXISTS `account-view`; -CREATE VIEW `account-view` AS SELECT +CREATE VIEW `account-view` AS SELECT `contact`.`id` AS `id`, `contact`.`url` AS `url`, `contact`.`nurl` AS `nurl`, @@ -2877,7 +2861,7 @@ CREATE VIEW `account-view` AS SELECT -- VIEW account-user-view -- DROP VIEW IF EXISTS `account-user-view`; -CREATE VIEW `account-user-view` AS SELECT +CREATE VIEW `account-user-view` AS SELECT `ucontact`.`id` AS `id`, `contact`.`id` AS `pid`, `ucontact`.`uid` AS `uid`, @@ -2981,7 +2965,7 @@ CREATE VIEW `account-user-view` AS SELECT -- VIEW pending-view -- DROP VIEW IF EXISTS `pending-view`; -CREATE VIEW `pending-view` AS SELECT +CREATE VIEW `pending-view` AS SELECT `register`.`id` AS `id`, `register`.`hash` AS `hash`, `register`.`created` AS `created`, @@ -3003,7 +2987,7 @@ CREATE VIEW `pending-view` AS SELECT -- VIEW tag-search-view -- DROP VIEW IF EXISTS `tag-search-view`; -CREATE VIEW `tag-search-view` AS SELECT +CREATE VIEW `tag-search-view` AS SELECT `post-tag`.`uri-id` AS `uri-id`, `post-user`.`uid` AS `uid`, `post-user`.`id` AS `iid`, @@ -3025,7 +3009,7 @@ CREATE VIEW `tag-search-view` AS SELECT -- VIEW workerqueue-view -- DROP VIEW IF EXISTS `workerqueue-view`; -CREATE VIEW `workerqueue-view` AS SELECT +CREATE VIEW `workerqueue-view` AS SELECT `process`.`pid` AS `pid`, `workerqueue`.`priority` AS `priority` FROM `process` @@ -3036,7 +3020,7 @@ CREATE VIEW `workerqueue-view` AS SELECT -- VIEW profile_field-view -- DROP VIEW IF EXISTS `profile_field-view`; -CREATE VIEW `profile_field-view` AS SELECT +CREATE VIEW `profile_field-view` AS SELECT `profile_field`.`id` AS `id`, `profile_field`.`uid` AS `uid`, `profile_field`.`label` AS `label`, @@ -3056,7 +3040,7 @@ CREATE VIEW `profile_field-view` AS SELECT -- VIEW diaspora-contact-view -- DROP VIEW IF EXISTS `diaspora-contact-view`; -CREATE VIEW `diaspora-contact-view` AS SELECT +CREATE VIEW `diaspora-contact-view` AS SELECT `diaspora-contact`.`uri-id` AS `uri-id`, `item-uri`.`uri` AS `url`, `item-uri`.`guid` AS `guid`, diff --git a/doc/database/db_addon.md b/doc/database/db_addon.md deleted file mode 100644 index 7233b80095..0000000000 --- a/doc/database/db_addon.md +++ /dev/null @@ -1,29 +0,0 @@ -Table addon -=========== - -registered addons - -Fields ------- - -| Field | Description | Type | Null | Key | Default | Extra | -| ------------ | --------------------------------------------- | ------------ | ---- | --- | ------- | -------------- | -| id | | int unsigned | NO | PRI | NULL | auto_increment | -| name | addon base (file)name | varchar(50) | NO | | | | -| version | currently unused | varchar(50) | NO | | | | -| installed | currently always 1 | boolean | NO | | 0 | | -| hidden | currently unused | boolean | NO | | 0 | | -| timestamp | file timestamp to check for reloads | int unsigned | NO | | 0 | | -| plugin_admin | 1 = has admin config, 0 = has no admin config | boolean | NO | | 0 | | - -Indexes ------------- - -| Name | Fields | -| -------------- | --------------- | -| PRIMARY | id | -| installed_name | installed, name | -| name | UNIQUE, name | - - -Return to [database documentation](help/database) diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 9179921d05..cc420a449b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -399,23 +399,6 @@ return [ "uid_uri-id" => ["uid", "uri-id"], ] ], - "addon" => [ - "comment" => "registered addons", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"], - "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"], - "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"], - "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"], - "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"], - "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "installed_name" => ["installed", "name"], - "name" => ["UNIQUE", "name"], - ] - ], "apcontact" => [ "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation", "fields" => [ From 7e92adef6c37b0f19f1660f9e7c276972a00b9b1 Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 21 Feb 2023 21:01:40 +0100 Subject: [PATCH 3/6] Fix API tests without addon table --- tests/src/Module/Api/ApiTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/Module/Api/ApiTest.php b/tests/src/Module/Api/ApiTest.php index 90dfa30b0a..812993aa98 100644 --- a/tests/src/Module/Api/ApiTest.php +++ b/tests/src/Module/Api/ApiTest.php @@ -24,6 +24,7 @@ namespace Friendica\Test\src\Module\Api; use Friendica\App; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Addon; +use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Hook; use Friendica\Database\Database; use Friendica\DI; @@ -212,15 +213,14 @@ abstract class ApiTest extends FixtureTest $func(DI::app()); } - /** @var Database $dba */ - $dba = $this->dice->create(Database::class); + /** @var $config IManageConfigValues */ + $config = $this->dice->create(IManageConfigValues::class); - $dba->insert('addon', [ + $config->set('addons', $addon, [ 'name' => $addon, 'installed' => true, 'timestamp' => $t, 'plugin_admin' => function_exists($addon . '_addon_admin'), - 'hidden' => file_exists('addon/' . $addon . '/.hidden') ]); Addon::loadAddons(); From fae2c6632caab1dda8eb5004297900b0c2a0159e Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 21 Feb 2023 21:01:57 +0100 Subject: [PATCH 4/6] Fix database --- database.sql | 40 ++++++++++++++++++++-------------------- doc/database.md | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/database.sql b/database.sql index 4c404356f6..ac3eaaf1df 100644 --- a/database.sql +++ b/database.sql @@ -1855,7 +1855,7 @@ CREATE TABLE IF NOT EXISTS `worker-ipc` ( -- VIEW application-view -- DROP VIEW IF EXISTS `application-view`; -CREATE VIEW `application-view` AS SELECT +CREATE VIEW `application-view` AS SELECT `application`.`id` AS `id`, `application-token`.`uid` AS `uid`, `application`.`name` AS `name`, @@ -1878,7 +1878,7 @@ CREATE VIEW `application-view` AS SELECT -- VIEW post-user-view -- DROP VIEW IF EXISTS `post-user-view`; -CREATE VIEW `post-user-view` AS SELECT +CREATE VIEW `post-user-view` AS SELECT `post-user`.`id` AS `id`, `post-user`.`id` AS `post-user-id`, `post-user`.`uid` AS `uid`, @@ -2057,7 +2057,7 @@ CREATE VIEW `post-user-view` AS SELECT -- VIEW post-thread-user-view -- DROP VIEW IF EXISTS `post-thread-user-view`; -CREATE VIEW `post-thread-user-view` AS SELECT +CREATE VIEW `post-thread-user-view` AS SELECT `post-user`.`id` AS `id`, `post-user`.`id` AS `post-user-id`, `post-thread-user`.`uid` AS `uid`, @@ -2234,7 +2234,7 @@ CREATE VIEW `post-thread-user-view` AS SELECT -- VIEW post-view -- DROP VIEW IF EXISTS `post-view`; -CREATE VIEW `post-view` AS SELECT +CREATE VIEW `post-view` AS SELECT `item-uri`.`uri` AS `uri`, `post`.`uri-id` AS `uri-id`, `parent-item-uri`.`uri` AS `parent-uri`, @@ -2374,7 +2374,7 @@ CREATE VIEW `post-view` AS SELECT -- VIEW post-thread-view -- DROP VIEW IF EXISTS `post-thread-view`; -CREATE VIEW `post-thread-view` AS SELECT +CREATE VIEW `post-thread-view` AS SELECT `item-uri`.`uri` AS `uri`, `post-thread`.`uri-id` AS `uri-id`, `parent-item-uri`.`uri` AS `parent-uri`, @@ -2516,7 +2516,7 @@ CREATE VIEW `post-thread-view` AS SELECT -- VIEW category-view -- DROP VIEW IF EXISTS `category-view`; -CREATE VIEW `category-view` AS SELECT +CREATE VIEW `category-view` AS SELECT `post-category`.`uri-id` AS `uri-id`, `post-category`.`uid` AS `uid`, `post-category`.`type` AS `type`, @@ -2530,7 +2530,7 @@ CREATE VIEW `category-view` AS SELECT -- VIEW collection-view -- DROP VIEW IF EXISTS `collection-view`; -CREATE VIEW `collection-view` AS SELECT +CREATE VIEW `collection-view` AS SELECT `post-collection`.`uri-id` AS `uri-id`, `post-collection`.`type` AS `type`, `post-collection`.`author-id` AS `cid`, @@ -2551,7 +2551,7 @@ CREATE VIEW `collection-view` AS SELECT -- VIEW media-view -- DROP VIEW IF EXISTS `media-view`; -CREATE VIEW `media-view` AS SELECT +CREATE VIEW `media-view` AS SELECT `post-media`.`uri-id` AS `uri-id`, `post-media`.`type` AS `type`, `post`.`received` AS `received`, @@ -2569,7 +2569,7 @@ CREATE VIEW `media-view` AS SELECT -- VIEW tag-view -- DROP VIEW IF EXISTS `tag-view`; -CREATE VIEW `tag-view` AS SELECT +CREATE VIEW `tag-view` AS SELECT `post-tag`.`uri-id` AS `uri-id`, `post-tag`.`type` AS `type`, `post-tag`.`tid` AS `tid`, @@ -2585,7 +2585,7 @@ CREATE VIEW `tag-view` AS SELECT -- VIEW network-item-view -- DROP VIEW IF EXISTS `network-item-view`; -CREATE VIEW `network-item-view` AS SELECT +CREATE VIEW `network-item-view` AS SELECT `post-user`.`uri-id` AS `uri-id`, `parent-post`.`id` AS `parent`, `post-user`.`received` AS `received`, @@ -2600,7 +2600,7 @@ CREATE VIEW `network-item-view` AS SELECT `post-user`.`contact-id` AS `contact-id`, `ownercontact`.`contact-type` AS `contact-type` FROM `post-user` - STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` + STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` INNER JOIN `contact` ON `contact`.`id` = `post-thread-user`.`contact-id` LEFT JOIN `user-contact` AS `author` ON `author`.`uid` = `post-thread-user`.`uid` AND `author`.`cid` = `post-thread-user`.`author-id` LEFT JOIN `user-contact` AS `owner` ON `owner`.`uid` = `post-thread-user`.`uid` AND `owner`.`cid` = `post-thread-user`.`owner-id` @@ -2616,7 +2616,7 @@ CREATE VIEW `network-item-view` AS SELECT -- VIEW network-thread-view -- DROP VIEW IF EXISTS `network-thread-view`; -CREATE VIEW `network-thread-view` AS SELECT +CREATE VIEW `network-thread-view` AS SELECT `post-thread-user`.`uri-id` AS `uri-id`, `parent-post`.`id` AS `parent`, `post-thread-user`.`received` AS `received`, @@ -2645,7 +2645,7 @@ CREATE VIEW `network-thread-view` AS SELECT -- VIEW owner-view -- DROP VIEW IF EXISTS `owner-view`; -CREATE VIEW `owner-view` AS SELECT +CREATE VIEW `owner-view` AS SELECT `contact`.`id` AS `id`, `contact`.`uid` AS `uid`, `contact`.`created` AS `created`, @@ -2775,7 +2775,7 @@ CREATE VIEW `owner-view` AS SELECT -- VIEW account-view -- DROP VIEW IF EXISTS `account-view`; -CREATE VIEW `account-view` AS SELECT +CREATE VIEW `account-view` AS SELECT `contact`.`id` AS `id`, `contact`.`url` AS `url`, `contact`.`nurl` AS `nurl`, @@ -2861,7 +2861,7 @@ CREATE VIEW `account-view` AS SELECT -- VIEW account-user-view -- DROP VIEW IF EXISTS `account-user-view`; -CREATE VIEW `account-user-view` AS SELECT +CREATE VIEW `account-user-view` AS SELECT `ucontact`.`id` AS `id`, `contact`.`id` AS `pid`, `ucontact`.`uid` AS `uid`, @@ -2965,7 +2965,7 @@ CREATE VIEW `account-user-view` AS SELECT -- VIEW pending-view -- DROP VIEW IF EXISTS `pending-view`; -CREATE VIEW `pending-view` AS SELECT +CREATE VIEW `pending-view` AS SELECT `register`.`id` AS `id`, `register`.`hash` AS `hash`, `register`.`created` AS `created`, @@ -2987,7 +2987,7 @@ CREATE VIEW `pending-view` AS SELECT -- VIEW tag-search-view -- DROP VIEW IF EXISTS `tag-search-view`; -CREATE VIEW `tag-search-view` AS SELECT +CREATE VIEW `tag-search-view` AS SELECT `post-tag`.`uri-id` AS `uri-id`, `post-user`.`uid` AS `uid`, `post-user`.`id` AS `iid`, @@ -3009,7 +3009,7 @@ CREATE VIEW `tag-search-view` AS SELECT -- VIEW workerqueue-view -- DROP VIEW IF EXISTS `workerqueue-view`; -CREATE VIEW `workerqueue-view` AS SELECT +CREATE VIEW `workerqueue-view` AS SELECT `process`.`pid` AS `pid`, `workerqueue`.`priority` AS `priority` FROM `process` @@ -3020,7 +3020,7 @@ CREATE VIEW `workerqueue-view` AS SELECT -- VIEW profile_field-view -- DROP VIEW IF EXISTS `profile_field-view`; -CREATE VIEW `profile_field-view` AS SELECT +CREATE VIEW `profile_field-view` AS SELECT `profile_field`.`id` AS `id`, `profile_field`.`uid` AS `uid`, `profile_field`.`label` AS `label`, @@ -3040,7 +3040,7 @@ CREATE VIEW `profile_field-view` AS SELECT -- VIEW diaspora-contact-view -- DROP VIEW IF EXISTS `diaspora-contact-view`; -CREATE VIEW `diaspora-contact-view` AS SELECT +CREATE VIEW `diaspora-contact-view` AS SELECT `diaspora-contact`.`uri-id` AS `uri-id`, `item-uri`.`uri` AS `url`, `item-uri`.`guid` AS `guid`, diff --git a/doc/database.md b/doc/database.md index edfb7b8226..461c1c2d9b 100644 --- a/doc/database.md +++ b/doc/database.md @@ -10,7 +10,6 @@ Database Tables | [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers | | [account-suggestion](help/database/db_account-suggestion) | Account suggestion | | [account-user](help/database/db_account-user) | Remote and local accounts | -| [addon](help/database/db_addon) | registered addons | | [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation | | [application](help/database/db_application) | OAuth application | | [application-marker](help/database/db_application-marker) | Timeline marker | From 433dd3e6efc8391d79e2e85e8a87e87ce6f07adf Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 21 Feb 2023 21:37:00 +0100 Subject: [PATCH 5/6] Update json-ld to 1.1.2 - Add support for local files for unsecured document loading --- composer.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.lock b/composer.lock index 0034780263..f9b96b1d9d 100644 --- a/composer.lock +++ b/composer.lock @@ -671,11 +671,11 @@ }, { "name": "friendica/json-ld", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://git.friendi.ca/friendica/php-json-ld", - "reference": "ca3916d10d2ad9073b3b1eae383978dbe828e1e1" + "reference": "5f6ea87b261d346e57f03457ae906e6835f0205f" }, "require": { "ext-json": "*", @@ -711,7 +711,7 @@ "Semantic Web", "jsonld" ], - "time": "2018-10-08T20:41:00+00:00" + "time": "2023-02-20T21:56:16+00:00" }, { "name": "fxp/composer-asset-plugin", From 08ba9e4183718df1941889a572c8bc9ddd190232 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 21 Feb 2023 21:07:41 +0000 Subject: [PATCH 6/6] Fix emoji activities --- src/Content/Conversation.php | 4 ++-- src/Model/Item.php | 2 +- src/Protocol/OStatus.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index 8107759534..249190b1ad 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -1146,8 +1146,8 @@ class Conversation $emojis[$row['thr-parent-id']][$index]['emoji'] = $emoji; $emojis[$row['thr-parent-id']][$index]['verb'] = $row['verb']; - $emojis[$row['thr-parent-id']][$index]['total'] = $emojis[$row['thr-parent-id']][$emoji]['total'] ?? 0 + $row['total']; - $emojis[$row['thr-parent-id']][$index]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$emoji]['title'] ?? [], explode($separator, $row['title']))); + $emojis[$row['thr-parent-id']][$index]['total'] = ($emojis[$row['thr-parent-id']][$index]['total'] ?? 0) + $row['total']; + $emojis[$row['thr-parent-id']][$index]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$index]['title'] ?? [], explode($separator, $row['title']))); } DBA::close($rows); diff --git a/src/Model/Item.php b/src/Model/Item.php index feb7ae6be6..a62d3c2e6e 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1212,7 +1212,7 @@ class Item } // The content of activities normally doesn't matter - except for likes from Misskey - if (!in_array($item['verb'], self::ACTIVITIES) || in_array($item['verb'], [Activity::LIKE, Activity::DISLIKE]) && !empty($item['body']) && ($item['body'] != $item['verb'])) { + if (!in_array($item['verb'], self::ACTIVITIES) || in_array($item['verb'], [Activity::LIKE, Activity::DISLIKE]) && !empty($item['body']) && (mb_strlen($item['body']) == 1)) { Post\Content::insert($item['uri-id'], $item); } diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 80644329ff..a93a0584dd 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -496,7 +496,7 @@ class OStatus $orig_uri = $xpath->query('activity:object/atom:id', $entry)->item(0)->nodeValue; Logger::notice('Favorite', ['uri' => $orig_uri, 'item' => $item]); - $item['verb'] = Activity::LIKE; + $item['body'] = $item['verb'] = Activity::LIKE; $item['thr-parent'] = $orig_uri; $item['gravity'] = Item::GRAVITY_ACTIVITY; $item['object-type'] = Activity\ObjectType::NOTE;