1
1
Fork 0

Merge branch 'develop' into fix-blocks-ignores-in-full-context-status-request

This commit is contained in:
Hank Grabowski 2023-02-22 13:26:28 -05:00
commit a301f8a82d
10 changed files with 16 additions and 74 deletions

6
composer.lock generated
View file

@ -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",

View file

@ -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
--

View file

@ -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 |

View file

@ -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)

View file

@ -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

View file

@ -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);

View file

@ -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);
}

View file

@ -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;

View file

@ -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" => [

View file

@ -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();