summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2022-11-22 16:28:06 -0100
committerGitHub <noreply@github.com>2022-11-22 16:28:06 -0100
commita21c75796fb49a20196153b71a11d48a77a555ca (patch)
tree72225cc1ba72975ec73a70b534377b159b4786de
parentdb427031e5afd02f4118f9a60890a4487240b2e5 (diff)
parent33080573fc555fd0b3410ef03e33191f2c65a9fa (diff)
Merge pull request #1517 from nextcloud/enh/noid/statuses-creation
status creation from mastodon client
-rw-r--r--appinfo/routes.php1
-rw-r--r--composer.lock142
-rw-r--r--lib/Command/Fediverse.php4
-rw-r--r--lib/Command/MigrateAlpha3.php4
-rw-r--r--lib/Command/NoteCreate.php12
-rw-r--r--lib/Command/QueueStatus.php2
-rw-r--r--lib/Command/Timeline.php7
-rw-r--r--lib/Controller/ApiController.php117
-rw-r--r--lib/Controller/OAuthController.php38
-rw-r--r--lib/Db/ActorsRequest.php6
-rw-r--r--lib/Db/ActorsRequestBuilder.php2
-rw-r--r--lib/Db/CacheActorsRequest.php4
-rw-r--r--lib/Db/ClientRequest.php2
-rw-r--r--lib/Db/CoreRequestBuilder.php4
-rw-r--r--lib/Db/RequestQueueRequest.php10
-rw-r--r--lib/Db/SocialCrossQueryBuilder.php4
-rw-r--r--lib/Db/SocialLimitsQueryBuilder.php2
-rw-r--r--lib/Db/StreamActionsRequest.php6
-rw-r--r--lib/Db/StreamQueueRequest.php4
-rw-r--r--lib/Db/StreamRequest.php55
-rw-r--r--lib/Db/StreamRequestBuilder.php8
-rw-r--r--lib/Migration/Version1000Date20221118000001.php2
-rw-r--r--lib/Model/Client/Options/TimelineOptions.php1
-rw-r--r--lib/Model/Client/Status.php163
-rw-r--r--lib/Service/PostService.php2
-rw-r--r--lib/Service/StreamService.php8
-rw-r--r--lib/Tools/Traits/TNCLogger.php24
27 files changed, 443 insertions, 191 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 861bcb93..bec44f7a 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -81,6 +81,7 @@ return [
['name' => 'Api#savedSearches', 'url' => '/api/saved_searches/list.json', 'verb' => 'GET'],
['name' => 'Api#timelines', 'url' => '/api/v1/timelines/{timeline}/', 'verb' => 'GET'],
['name' => 'Api#notifications', 'url' => '/api/v1/notifications', 'verb' => 'GET'],
+ ['name' => 'Api#statusNew', 'url' => '/api/v1/statuses', 'verb' => 'POST'],
// Api for local front-end
// TODO: front-end should be using the new ApiController
diff --git a/composer.lock b/composer.lock
index 3e65302c..851cab56 100644
--- a/composer.lock
+++ b/composer.lock
@@ -352,16 +352,16 @@
},
{
"name": "composer/pcre",
- "version": "3.0.2",
+ "version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/composer/pcre.git",
- "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb"
+ "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/pcre/zipball/4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb",
- "reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
+ "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
"shasum": ""
},
"require": {
@@ -403,7 +403,7 @@
],
"support": {
"issues": "https://github.com/composer/pcre/issues",
- "source": "https://github.com/composer/pcre/tree/3.0.2"
+ "source": "https://github.com/composer/pcre/tree/3.1.0"
},
"funding": [
{
@@ -419,7 +419,7 @@
"type": "tidelift"
}
],
- "time": "2022-11-03T20:24:16+00:00"
+ "time": "2022-11-17T09:50:14+00:00"
},
{
"name": "composer/semver",
@@ -1171,12 +1171,12 @@
"source": {
"type": "git",
"url": "https://github.com/nextcloud-deps/ocp.git",
- "reference": "81fabae31c9bb142d5d0d4d52384fe98d757ab49"
+ "reference": "d1f996e8d03a10184d48a0120282886b3f7806f7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/81fabae31c9bb142d5d0d4d52384fe98d757ab49",
- "reference": "81fabae31c9bb142d5d0d4d52384fe98d757ab49",
+ "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/d1f996e8d03a10184d48a0120282886b3f7806f7",
+ "reference": "d1f996e8d03a10184d48a0120282886b3f7806f7",
"shasum": ""
},
"require": {
@@ -1207,20 +1207,20 @@
"issues": "https://github.com/nextcloud-deps/ocp/issues",
"source": "https://github.com/nextcloud-deps/ocp/tree/master"
},
- "time": "2022-11-04T00:49:09+00:00"
+ "time": "2022-11-10T00:44:20+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.15.1",
+ "version": "v4.15.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
+ "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
- "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
+ "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
"shasum": ""
},
"require": {
@@ -1261,9 +1261,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2"
},
- "time": "2022-09-04T07:30:47+00:00"
+ "time": "2022-11-12T15:38:23+00:00"
},
{
"name": "openlss/lib-array2xml",
@@ -1596,16 +1596,16 @@
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.18",
+ "version": "9.2.19",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a"
+ "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
- "reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559",
+ "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559",
"shasum": ""
},
"require": {
@@ -1661,7 +1661,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.18"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19"
},
"funding": [
{
@@ -1669,7 +1669,7 @@
"type": "github"
}
],
- "time": "2022-10-27T13:35:33+00:00"
+ "time": "2022-11-18T07:47:47+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -3703,16 +3703,16 @@
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
+ "reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
- "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
+ "reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
"shasum": ""
},
"require": {
@@ -3727,7 +3727,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3765,7 +3765,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
},
"funding": [
{
@@ -3781,20 +3781,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "433d05519ce6990bf3530fba6957499d327395c2"
+ "reference": "511a08c03c1960e08a883f4cffcacd219b758354"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2",
- "reference": "433d05519ce6990bf3530fba6957499d327395c2",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354",
+ "reference": "511a08c03c1960e08a883f4cffcacd219b758354",
"shasum": ""
},
"require": {
@@ -3806,7 +3806,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3846,7 +3846,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0"
},
"funding": [
{
@@ -3862,20 +3862,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
- "reference": "219aa369ceff116e673852dce47c3a41794c14bd"
+ "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd",
- "reference": "219aa369ceff116e673852dce47c3a41794c14bd",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6",
+ "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6",
"shasum": ""
},
"require": {
@@ -3887,7 +3887,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -3930,7 +3930,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0"
},
"funding": [
{
@@ -3946,20 +3946,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
+ "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@@ -3974,7 +3974,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -4013,7 +4013,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
},
"funding": [
{
@@ -4029,20 +4029,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
+ "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
- "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
+ "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
"shasum": ""
},
"require": {
@@ -4051,7 +4051,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -4092,7 +4092,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0"
},
"funding": [
{
@@ -4108,20 +4108,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
+ "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
- "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
+ "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"shasum": ""
},
"require": {
@@ -4130,7 +4130,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -4175,7 +4175,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
},
"funding": [
{
@@ -4191,20 +4191,20 @@
"type": "tidelift"
}
],
- "time": "2022-05-10T07:21:04+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-php81",
- "version": "v1.26.0",
+ "version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
+ "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
- "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a",
+ "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a",
"shasum": ""
},
"require": {
@@ -4213,7 +4213,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "1.26-dev"
+ "dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -4254,7 +4254,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0"
},
"funding": [
{
@@ -4270,7 +4270,7 @@
"type": "tidelift"
}
],
- "time": "2022-05-24T11:49:31+00:00"
+ "time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/process",
diff --git a/lib/Command/Fediverse.php b/lib/Command/Fediverse.php
index 0a9e7535..e2801bbd 100644
--- a/lib/Command/Fediverse.php
+++ b/lib/Command/Fediverse.php
@@ -58,8 +58,8 @@ class Fediverse extends Base {
parent::configure();
$this->setName('social:fediverse')
->addOption(
- 'type', 't', InputArgument::OPTIONAL,
- 'Change the type of access management', ''
+ 'type', 't', InputArgument::OPTIONAL,
+ 'Change the type of access management', ''
)
->addArgument('action', InputArgument::OPTIONAL, 'add/remove/test address', '')
->addArgument('address', InputArgument::OPTIONAL, 'address/host', '')
diff --git a/lib/Command/MigrateAlpha3.php b/lib/Command/MigrateAlpha3.php
index e8f9cbac..05774920 100644
--- a/lib/Command/MigrateAlpha3.php
+++ b/lib/Command/MigrateAlpha3.php
@@ -119,10 +119,10 @@ class MigrateAlpha3 extends Base {
$this->setName('social:migrate:alpha3')
->setDescription('Trying to migrate old data to Alpha3')
->addOption(
- 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done'
+ 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done'
)
->addOption(
- 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables'
+ 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables'
);
}
diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php
index 2aed76e4..d5ea7827 100644
--- a/lib/Command/NoteCreate.php
+++ b/lib/Command/NoteCreate.php
@@ -96,18 +96,18 @@ class NoteCreate extends Base {
parent::configure();
$this->setName('social:note:create')
->addOption(
- 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread'
+ 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread'
)
->addOption(
- 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people'
+ 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people'
)
->addOption(
- 'type', 'y', InputOption::VALUE_OPTIONAL,
- 'type: public (default), followers, unlisted, direct'
+ 'type', 'y', InputOption::VALUE_OPTIONAL,
+ 'type: public (default), followers, unlisted, direct'
)
->addOption(
- 'hashtag', 'g', InputOption::VALUE_OPTIONAL,
- 'hashtag, without the leading #'
+ 'hashtag', 'g', InputOption::VALUE_OPTIONAL,
+ 'hashtag, without the leading #'
)
->addArgument('user_id', InputArgument::REQUIRED, 'userId of the author')
->addArgument('content', InputArgument::REQUIRED, 'content of the post')
diff --git a/lib/Command/QueueStatus.php b/lib/Command/QueueStatus.php
index 3de1e7ba..2e2bbbc3 100644
--- a/lib/Command/QueueStatus.php
+++ b/lib/Command/QueueStatus.php
@@ -73,7 +73,7 @@ class QueueStatus extends Base {
parent::configure();
$this->setName('social:queue:status')
->addOption(
- 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request'
+ 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request'
)
->setDescription('Return status on the request queue');
}
diff --git a/lib/Command/Timeline.php b/lib/Command/Timeline.php
index b85f91ab..433118c2 100644
--- a/lib/Command/Timeline.php
+++ b/lib/Command/Timeline.php
@@ -91,6 +91,7 @@ class Timeline extends ExtendedBase {
$this->setName('social:stream')
->addArgument('userId', InputArgument::REQUIRED, 'viewer')
->addArgument('timeline', InputArgument::REQUIRED, 'timeline')
+ ->addOption('local', '', InputOption::VALUE_NONE, 'public')
->addOption('count', '', InputOption::VALUE_REQUIRED, 'number of elements', '5')
->addOption('min_id', '', InputOption::VALUE_REQUIRED, 'min_id', 0)
->addOption('max_id', '', InputOption::VALUE_REQUIRED, 'max_id', 0)
@@ -133,10 +134,12 @@ class Timeline extends ExtendedBase {
->setMaxId(intval($input->getOption('max_id')));
try {
- $options->setTimeline($input->getArgument('timeline'));
+ if ($input->getOption('local')) {
+ $options->setLocal(true);
+ }
+ $options->setTimeline($timeline = $input->getArgument('timeline'));
$this->outputStreams($this->streamRequest->getTimeline($options));
} catch (UnknownTimelineException $e) {
- echo $input->getArgument('timeline');
$this->displayUnsupportedStream($options);
}
diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php
index a6dc9fba..c089b003 100644
--- a/lib/Controller/ApiController.php
+++ b/lib/Controller/ApiController.php
@@ -30,7 +30,6 @@ declare(strict_types=1);
namespace OCA\Social\Controller;
-use OCA\Social\Tools\Traits\TNCDataResponse;
use Exception;
use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountDoesNotExistException;
@@ -41,19 +40,23 @@ use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Model\ActivityPub\Stream;
use OCA\Social\Model\Client\Options\TimelineOptions;
use OCA\Social\Model\Client\SocialClient;
+use OCA\Social\Model\Client\Status;
+use OCA\Social\Model\Post;
use OCA\Social\Service\AccountService;
use OCA\Social\Service\CacheActorService;
use OCA\Social\Service\ClientService;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\FollowService;
use OCA\Social\Service\InstanceService;
-use OCA\Social\Service\MiscService;
+use OCA\Social\Service\PostService;
use OCA\Social\Service\StreamService;
+use OCA\Social\Tools\Traits\TNCDataResponse;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCP\IUserSession;
+use Psr\Log\LoggerInterface;
/**
* Class ApiController
@@ -64,35 +67,45 @@ class ApiController extends Controller {
use TNCDataResponse;
private IUserSession $userSession;
+ private LoggerInterface $logger;
private InstanceService $instanceService;
private ClientService $clientService;
private AccountService $accountService;
private CacheActorService $cacheActorService;
private FollowService $followService;
private StreamService $streamService;
+ private PostService $postService;
private ConfigService $configService;
- private MiscService $miscService;
+
private string $bearer = '';
private ?SocialClient $client = null;
private ?Person $viewer = null;
public function __construct(
- IRequest $request, IUserSession $userSession, InstanceService $instanceService,
- ClientService $clientService, AccountService $accountService, CacheActorService $cacheActorService,
- FollowService $followService, StreamService $streamService, ConfigService $configService,
- MiscService $miscService
+ IRequest $request,
+ IUserSession $userSession,
+ LoggerInterface $logger,
+ InstanceService $instanceService,
+ ClientService $clientService,
+ AccountService $accountService,
+ CacheActorService $cacheActorService,
+ FollowService $followService,
+ StreamService $streamService,
+ PostService $postService,
+ ConfigService $configService
) {
parent::__construct(Application::APP_NAME, $request);
$this->userSession = $userSession;
+