kopia lustrzana https://github.com/nextcloud/social
status creation from mastodon client
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/1517/head
rodzic
72be817000
commit
b32fa07f9c
|
@ -81,6 +81,7 @@ return [
|
||||||
['name' => 'Api#savedSearches', 'url' => '/api/saved_searches/list.json', 'verb' => 'GET'],
|
['name' => 'Api#savedSearches', 'url' => '/api/saved_searches/list.json', 'verb' => 'GET'],
|
||||||
['name' => 'Api#timelines', 'url' => '/api/v1/timelines/{timeline}/', 'verb' => 'GET'],
|
['name' => 'Api#timelines', 'url' => '/api/v1/timelines/{timeline}/', 'verb' => 'GET'],
|
||||||
['name' => 'Api#notifications', 'url' => '/api/v1/notifications', '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
|
// Api for local front-end
|
||||||
// TODO: front-end should be using the new ApiController
|
// TODO: front-end should be using the new ApiController
|
||||||
|
|
|
@ -352,16 +352,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/pcre",
|
"name": "composer/pcre",
|
||||||
"version": "3.0.2",
|
"version": "3.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/composer/pcre.git",
|
"url": "https://github.com/composer/pcre.git",
|
||||||
"reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb"
|
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/composer/pcre/zipball/4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb",
|
"url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||||
"reference": "4482b6409ca6bfc2af043a5711cd21ac3e7a8dfb",
|
"reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -403,7 +403,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/composer/pcre/issues",
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -419,7 +419,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-11-03T20:24:16+00:00"
|
"time": "2022-11-17T09:50:14+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
|
@ -1171,12 +1171,12 @@
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nextcloud-deps/ocp.git",
|
"url": "https://github.com/nextcloud-deps/ocp.git",
|
||||||
"reference": "81fabae31c9bb142d5d0d4d52384fe98d757ab49"
|
"reference": "d1f996e8d03a10184d48a0120282886b3f7806f7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/81fabae31c9bb142d5d0d4d52384fe98d757ab49",
|
"url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/d1f996e8d03a10184d48a0120282886b3f7806f7",
|
||||||
"reference": "81fabae31c9bb142d5d0d4d52384fe98d757ab49",
|
"reference": "d1f996e8d03a10184d48a0120282886b3f7806f7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1207,20 +1207,20 @@
|
||||||
"issues": "https://github.com/nextcloud-deps/ocp/issues",
|
"issues": "https://github.com/nextcloud-deps/ocp/issues",
|
||||||
"source": "https://github.com/nextcloud-deps/ocp/tree/master"
|
"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",
|
"name": "nikic/php-parser",
|
||||||
"version": "v4.15.1",
|
"version": "v4.15.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900"
|
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||||
"reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900",
|
"reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1261,9 +1261,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
"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",
|
"name": "openlss/lib-array2xml",
|
||||||
|
@ -1596,16 +1596,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
"version": "9.2.18",
|
"version": "9.2.19",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||||
"reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a"
|
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559",
|
||||||
"reference": "12fddc491826940cf9b7e88ad9664cf51f0f6d0a",
|
"reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1661,7 +1661,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -1669,7 +1669,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-10-27T13:35:33+00:00"
|
"time": "2022-11-18T07:47:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-file-iterator",
|
"name": "phpunit/php-file-iterator",
|
||||||
|
@ -3703,16 +3703,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3727,7 +3727,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -3765,7 +3765,7 @@
|
||||||
"portable"
|
"portable"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3781,20 +3781,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-grapheme",
|
"name": "symfony/polyfill-intl-grapheme",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
|
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
|
||||||
"reference": "433d05519ce6990bf3530fba6957499d327395c2"
|
"reference": "511a08c03c1960e08a883f4cffcacd219b758354"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2",
|
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354",
|
||||||
"reference": "433d05519ce6990bf3530fba6957499d327395c2",
|
"reference": "511a08c03c1960e08a883f4cffcacd219b758354",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3806,7 +3806,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -3846,7 +3846,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3862,20 +3862,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-normalizer",
|
"name": "symfony/polyfill-intl-normalizer",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
||||||
"reference": "219aa369ceff116e673852dce47c3a41794c14bd"
|
"reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd",
|
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6",
|
||||||
"reference": "219aa369ceff116e673852dce47c3a41794c14bd",
|
"reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3887,7 +3887,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -3930,7 +3930,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -3946,20 +3946,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -3974,7 +3974,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -4013,7 +4013,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -4029,20 +4029,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-php73",
|
"name": "symfony/polyfill-php73",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-php73.git",
|
"url": "https://github.com/symfony/polyfill-php73.git",
|
||||||
"reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
|
"reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
|
"url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
|
||||||
"reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
|
"reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -4051,7 +4051,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -4092,7 +4092,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -4108,20 +4108,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-php80",
|
"name": "symfony/polyfill-php80",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
|
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||||
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
|
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -4130,7 +4130,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -4175,7 +4175,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -4191,20 +4191,20 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-10T07:21:04+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-php81",
|
"name": "symfony/polyfill-php81",
|
||||||
"version": "v1.26.0",
|
"version": "v1.27.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-php81.git",
|
"url": "https://github.com/symfony/polyfill-php81.git",
|
||||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
|
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||||
"reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
|
"reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -4213,7 +4213,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.26-dev"
|
"dev-main": "1.27-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
|
@ -4254,7 +4254,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
|
"source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -4270,7 +4270,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-05-24T11:49:31+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
|
|
|
@ -91,6 +91,7 @@ class Timeline extends ExtendedBase {
|
||||||
$this->setName('social:stream')
|
$this->setName('social:stream')
|
||||||
->addArgument('userId', InputArgument::REQUIRED, 'viewer')
|
->addArgument('userId', InputArgument::REQUIRED, 'viewer')
|
||||||
->addArgument('timeline', InputArgument::REQUIRED, 'timeline')
|
->addArgument('timeline', InputArgument::REQUIRED, 'timeline')
|
||||||
|
->addOption('local', '', InputOption::VALUE_NONE, 'public')
|
||||||
->addOption('count', '', InputOption::VALUE_REQUIRED, 'number of elements', '5')
|
->addOption('count', '', InputOption::VALUE_REQUIRED, 'number of elements', '5')
|
||||||
->addOption('min_id', '', InputOption::VALUE_REQUIRED, 'min_id', 0)
|
->addOption('min_id', '', InputOption::VALUE_REQUIRED, 'min_id', 0)
|
||||||
->addOption('max_id', '', InputOption::VALUE_REQUIRED, 'max_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')));
|
->setMaxId(intval($input->getOption('max_id')));
|
||||||
|
|
||||||
try {
|
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));
|
$this->outputStreams($this->streamRequest->getTimeline($options));
|
||||||
} catch (UnknownTimelineException $e) {
|
} catch (UnknownTimelineException $e) {
|
||||||
echo $input->getArgument('timeline');
|
|
||||||
$this->displayUnsupportedStream($options);
|
$this->displayUnsupportedStream($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace OCA\Social\Controller;
|
namespace OCA\Social\Controller;
|
||||||
|
|
||||||
use OCA\Social\Tools\Traits\TNCDataResponse;
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use OCA\Social\AppInfo\Application;
|
use OCA\Social\AppInfo\Application;
|
||||||
use OCA\Social\Exceptions\AccountDoesNotExistException;
|
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\ActivityPub\Stream;
|
||||||
use OCA\Social\Model\Client\Options\TimelineOptions;
|
use OCA\Social\Model\Client\Options\TimelineOptions;
|
||||||
use OCA\Social\Model\Client\SocialClient;
|
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\AccountService;
|
||||||
use OCA\Social\Service\CacheActorService;
|
use OCA\Social\Service\CacheActorService;
|
||||||
use OCA\Social\Service\ClientService;
|
use OCA\Social\Service\ClientService;
|
||||||
use OCA\Social\Service\ConfigService;
|
use OCA\Social\Service\ConfigService;
|
||||||
use OCA\Social\Service\FollowService;
|
use OCA\Social\Service\FollowService;
|
||||||
use OCA\Social\Service\InstanceService;
|
use OCA\Social\Service\InstanceService;
|
||||||
use OCA\Social\Service\MiscService;
|
use OCA\Social\Service\PostService;
|
||||||
use OCA\Social\Service\StreamService;
|
use OCA\Social\Service\StreamService;
|
||||||
|
use OCA\Social\Tools\Traits\TNCDataResponse;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http;
|
use OCP\AppFramework\Http;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ApiController
|
* Class ApiController
|
||||||
|
@ -64,35 +67,45 @@ class ApiController extends Controller {
|
||||||
use TNCDataResponse;
|
use TNCDataResponse;
|
||||||
|
|
||||||
private IUserSession $userSession;
|
private IUserSession $userSession;
|
||||||
|
private LoggerInterface $logger;
|
||||||
private InstanceService $instanceService;
|
private InstanceService $instanceService;
|
||||||
private ClientService $clientService;
|
private ClientService $clientService;
|
||||||
private AccountService $accountService;
|
private AccountService $accountService;
|
||||||
private CacheActorService $cacheActorService;
|
private CacheActorService $cacheActorService;
|
||||||
private FollowService $followService;
|
private FollowService $followService;
|
||||||
private StreamService $streamService;
|
private StreamService $streamService;
|
||||||
|
private PostService $postService;
|
||||||
private ConfigService $configService;
|
private ConfigService $configService;
|
||||||
private MiscService $miscService;
|
|
||||||
private string $bearer = '';
|
private string $bearer = '';
|
||||||
private ?SocialClient $client = null;
|
private ?SocialClient $client = null;
|
||||||
private ?Person $viewer = null;
|
private ?Person $viewer = null;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
IRequest $request, IUserSession $userSession, InstanceService $instanceService,
|
IRequest $request,
|
||||||
ClientService $clientService, AccountService $accountService, CacheActorService $cacheActorService,
|
IUserSession $userSession,
|
||||||
FollowService $followService, StreamService $streamService, ConfigService $configService,
|
LoggerInterface $logger,
|
||||||
MiscService $miscService
|
InstanceService $instanceService,
|
||||||
|
ClientService $clientService,
|
||||||
|
AccountService $accountService,
|
||||||
|
CacheActorService $cacheActorService,
|
||||||
|
FollowService $followService,
|
||||||
|
StreamService $streamService,
|
||||||
|
PostService $postService,
|
||||||
|
ConfigService $configService
|
||||||
) {
|
) {
|
||||||
parent::__construct(Application::APP_NAME, $request);
|
parent::__construct(Application::APP_NAME, $request);
|
||||||
|
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
|
$this->logger = $logger;
|
||||||
$this->instanceService = $instanceService;
|
$this->instanceService = $instanceService;
|
||||||
$this->clientService = $clientService;
|
$this->clientService = $clientService;
|
||||||
$this->accountService = $accountService;
|
$this->accountService = $accountService;
|
||||||
$this->cacheActorService = $cacheActorService;
|
$this->cacheActorService = $cacheActorService;
|
||||||
$this->followService = $followService;
|
$this->followService = $followService;
|
||||||
$this->streamService = $streamService;
|
$this->streamService = $streamService;
|
||||||
|
$this->postService = $postService;
|
||||||
$this->configService = $configService;
|
$this->configService = $configService;
|
||||||
$this->miscService = $miscService;
|
|
||||||
|
|
||||||
$authHeader = trim($this->request->getHeader('Authorization'));
|
$authHeader = trim($this->request->getHeader('Authorization'));
|
||||||
if (strpos($authHeader, ' ')) {
|
if (strpos($authHeader, ' ')) {
|
||||||
|
@ -211,26 +224,68 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @PublicPage
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*
|
||||||
|
* @return DataResponse
|
||||||
|
*/
|
||||||
|
public function statusNew(): DataResponse {
|
||||||
|
try {
|
||||||
|
$this->initViewer(true);
|
||||||
|
|
||||||
|
$input = file_get_contents('php://input');
|
||||||
|
$this->logger->debug('[ApiController] newStatus: ' . $input);
|
||||||
|
|
||||||
|
$status = new Status();
|
||||||
|
$status->import($this->convertInput($input));
|
||||||
|
|
||||||
|
$post = new Post($this->accountService->getActorFromUserId($this->currentSession()));
|
||||||
|
$post->setContent($status->getStatus());
|
||||||
|
$post->setType($status->getVisibility());
|
||||||
|
|
||||||
|
$activity = $this->postService->createPost($post);
|
||||||
|
$activity->setExportFormat(ACore::FORMAT_LOCAL);
|
||||||
|
|
||||||
|
return new DataResponse($activity, Http::STATUS_OK);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->logger->warning('issues while statusNew', ['exception' => $e]);
|
||||||
|
|
||||||
|
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
* @PublicPage
|
* @PublicPage
|
||||||
*
|
*
|
||||||
* @param string $timeline
|
* @param string $timeline
|
||||||
|
* @param bool $local
|
||||||
* @param int $limit
|
* @param int $limit
|
||||||
* @param int $max_id
|
* @param int $max_id
|
||||||
* @param int $min_id
|
* @param int $min_id
|
||||||
|
*
|
||||||
* @return DataResponse
|
* @return DataResponse
|
||||||
*/
|
*/
|
||||||
public function timelines(string $timeline, int $limit = 20, int $max_id = 0, int $min_id = 0): DataResponse {
|
public function timelines(
|
||||||
$options = new TimelineOptions($this->request);
|
string $timeline,
|
||||||
$options->setFormat(Stream::FORMAT_LOCAL);
|
bool $local = false,
|
||||||
$options->setTimeline($timeline);
|
int $limit = 20,
|
||||||
$options->setLimit($limit);
|
int $max_id = 0,
|
||||||
$options->setMaxId($max_id);
|
int $min_id = 0
|
||||||
$options->setMinId($min_id);
|
): DataResponse {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->initViewer(true);
|
$this->initViewer(true);
|
||||||
|
|
||||||
|
$options = new TimelineOptions($this->request);
|
||||||
|
$options->setFormat(ACore::FORMAT_LOCAL);
|
||||||
|
$options->setTimeline($timeline);
|
||||||
|
$options->setLocal($local);
|
||||||
|
$options->setLimit($limit);
|
||||||
|
$options->setMaxId($max_id);
|
||||||
|
$options->setMinId($min_id);
|
||||||
|
|
||||||
$posts = $this->streamService->getTimeline($options);
|
$posts = $this->streamService->getTimeline($options);
|
||||||
|
|
||||||
return new DataResponse($posts, Http::STATUS_OK);
|
return new DataResponse($posts, Http::STATUS_OK);
|
||||||
|
@ -251,8 +306,8 @@ class ApiController extends Controller {
|
||||||
try {
|
try {
|
||||||
$userId = $this->currentSession();
|
$userId = $this->currentSession();
|
||||||
|
|
||||||
$this->miscService->log(
|
$this->logger->debug(
|
||||||
'[ApiController] initViewer: ' . $userId . ' (bearer=' . $this->bearer . ')', 0
|
'[ApiController] initViewer: ' . $userId . ' (bearer=' . $this->bearer . ')'
|
||||||
);
|
);
|
||||||
|
|
||||||
$account = $this->accountService->getActorFromUserId($userId);
|
$account = $this->accountService->getActorFromUserId($userId);
|
||||||
|
@ -274,6 +329,32 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function convertInput(string $input): array {
|
||||||
|
$contentType = $this->request->getHeader('Content-Type');
|
||||||
|
|
||||||
|
$pos = strpos($contentType, ';');
|
||||||
|
if ($pos > 0) {
|
||||||
|
$contentType = substr($contentType, 0, $pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($contentType) {
|
||||||
|
case 'application/json':
|
||||||
|
return json_decode($input, true);
|
||||||
|
|
||||||
|
case 'application/x-www-form-urlencoded':
|
||||||
|
return $this->request->getParams();
|
||||||
|
|
||||||
|
default: // in case of no header ...
|
||||||
|
$result = json_decode($input, true);
|
||||||
|
if (is_array($result)) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->request->getParams();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
* @throws AccountDoesNotExistException
|
* @throws AccountDoesNotExistException
|
||||||
|
|
|
@ -313,7 +313,7 @@ class SocialLimitsQueryBuilder extends SocialCrossQueryBuilder {
|
||||||
* @param bool $local
|
* @param bool $local
|
||||||
*/
|
*/
|
||||||
public function limitToLocal(bool $local) {
|
public function limitToLocal(bool $local) {
|
||||||
$this->limitToDBField('local', ($local) ? '1' : '0');
|
$this->limitToDBFieldInt('local', ($local) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -188,15 +188,23 @@ class StreamRequest extends StreamRequestBuilder {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param string $id
|
||||||
|
* @param bool $asViewer
|
||||||
|
* @param int $format
|
||||||
|
*
|
||||||
* @return Stream
|
* @return Stream
|
||||||
* @throws StreamNotFoundException
|
* @throws StreamNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getStreamById(string $id, bool $asViewer = false): Stream {
|
public function getStreamById(
|
||||||
|
string $id,
|
||||||
|
bool $asViewer = false,
|
||||||
|
int $format = ACore::FORMAT_ACTIVITYPUB
|
||||||
|
): Stream {
|
||||||
if ($id === '') {
|
if ($id === '') {
|
||||||
throw new StreamNotFoundException();
|
throw new StreamNotFoundException();
|
||||||
};
|
};
|
||||||
|
|
||||||
$qb = $this->getStreamSelectSql();
|
$qb = $this->getStreamSelectSql($format);
|
||||||
$qb->limitToIdPrim($qb->prim($id));
|
$qb->limitToIdPrim($qb->prim($id));
|
||||||
$qb->linkToCacheActors('ca', 's.attributed_to_prim');
|
$qb->linkToCacheActors('ca', 's.attributed_to_prim');
|
||||||
|
|
||||||
|
@ -340,11 +348,6 @@ class StreamRequest extends StreamRequestBuilder {
|
||||||
$result = $this->getTimelineDirect($options);
|
$result = $this->getTimelineDirect($options);
|
||||||
break;
|
break;
|
||||||
case 'public':
|
case 'public':
|
||||||
$options->setLocal(false);
|
|
||||||
$result = $this->getTimelinePublic($options);
|
|
||||||
break;
|
|
||||||
case 'local':
|
|
||||||
$options->setLocal(true);
|
|
||||||
$result = $this->getTimelinePublic($options);
|
$result = $this->getTimelinePublic($options);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ class TimelineOptions extends CoreOptions implements JsonSerializable {
|
||||||
|
|
||||||
public static array $availableTimelines = [
|
public static array $availableTimelines = [
|
||||||
'home',
|
'home',
|
||||||
'local',
|
|
||||||
'public'
|
'public'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,163 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nextcloud - Social Support
|
||||||
|
*
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or
|
||||||
|
* later. See the COPYING file.
|
||||||
|
*
|
||||||
|
* @author Maxence Lange <maxence@artificial-owl.com>
|
||||||
|
* @copyright 2022, Maxence Lange <maxence@artificial-owl.com>
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\Social\Model\Client;
|
||||||
|
|
||||||
|
use OCA\Social\Tools\Traits\TArrayTools;
|
||||||
|
|
||||||
|
class Status implements \JsonSerializable {
|
||||||
|
use TArrayTools;
|
||||||
|
|
||||||
|
private string $contentType = '';
|
||||||
|
private bool $sensitive = false;
|
||||||
|
private string $visibility = '';
|
||||||
|
private string $spoilerText = '';
|
||||||
|
private string $status = '';
|
||||||
|
|
||||||
|
//"media_ids": [],
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $contentType
|
||||||
|
*
|
||||||
|
* @return Status
|
||||||
|
*/
|
||||||
|
public function setContentType(string $contentType): self {
|
||||||
|
$this->contentType = $contentType;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getContentType(): string {
|
||||||
|
return $this->contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bool $sensitive
|
||||||
|
*
|
||||||
|
* @return Status
|
||||||
|
*/
|
||||||
|
public function setSensitive(bool $sensitive): self {
|
||||||
|
$this->sensitive = $sensitive;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isSensitive(): bool {
|
||||||
|
return $this->sensitive;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $visibility
|
||||||
|
*
|
||||||
|
* @return Status
|
||||||
|
*/
|
||||||
|
public function setVisibility(string $visibility): self {
|
||||||
|
$this->visibility = $visibility;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getVisibility(): string {
|
||||||
|
return $this->visibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $spoilerText
|
||||||
|
*
|
||||||
|
* @return Status
|
||||||
|
*/
|
||||||
|
public function setSpoilerText(string $spoilerText): self {
|
||||||
|
$this->spoilerText = $spoilerText;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSpoilerText(): string {
|
||||||
|
return $this->spoilerText;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $status
|
||||||
|
*
|
||||||
|
* @return Status
|
||||||
|
*/
|
||||||
|
public function setStatus(string $status): self {
|
||||||
|
$this->status = $status;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getStatus(): string {
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function import(array $data): self {
|
||||||
|
$this->setContentType($this->get('content_type', $data));
|
||||||
|
$this->setSensitive($this->getBool('sensitive', $data));
|
||||||
|
$this->setVisibility($this->get('visibility', $data));
|
||||||
|
$this->setSpoilerText($this->get('spoiler_text', $data));
|
||||||
|
$this->setStatus($this->get('status', $data));
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function jsonSerialize(): array {
|
||||||
|
return [
|
||||||
|
'contentType' => $this->getContentType(),
|
||||||
|
'sensitive' => $this->isSensitive(),
|
||||||
|
'visibility' => $this->getVisibility(),
|
||||||
|
'spoilerText' => $this->getSpoilerText(),
|
||||||
|
'status' => $this->getStatus()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
|
@ -97,7 +97,7 @@ class PostService {
|
||||||
* @throws StreamNotFoundException
|
* @throws StreamNotFoundException
|
||||||
* @throws UnauthorizedFediverseException
|
* @throws UnauthorizedFediverseException
|
||||||
*/
|
*/
|
||||||
public function createPost(Post $post, &$token = ''): ACore {
|
public function createPost(Post $post, string &$token = ''): ACore {
|
||||||
$this->fixRecipientAndHashtags($post);
|
$this->fixRecipientAndHashtags($post);
|
||||||
|
|
||||||
$note = new Note();
|
$note = new Note();
|
||||||
|
|
|
@ -370,8 +370,12 @@ class StreamService {
|
||||||
* @return Stream
|
* @return Stream
|
||||||
* @throws StreamNotFoundException
|
* @throws StreamNotFoundException
|
||||||
*/
|
*/
|
||||||
public function getStreamById(string $id, bool $asViewer = false): Stream {
|
public function getStreamById(
|
||||||
return $this->streamRequest->getStreamById($id, $asViewer);
|
string $id,
|
||||||
|
bool $asViewer = false,
|
||||||
|
int $format = ACore::FORMAT_ACTIVITYPUB
|
||||||
|
): Stream {
|
||||||
|
return $this->streamRequest->getStreamById($id, $asViewer, $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue