Merge branch 'friendica:2022.12-rc' into new_image_presentation

This commit is contained in:
MarekBenjamin 2022-12-12 17:59:42 +01:00 committed by GitHub
commit d2b23d57e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 7 deletions

35
src/Module/About.php Normal file
View File

@ -0,0 +1,35 @@
<?php
/**
* @copyright Copyright (C) 2010-2022, the Friendica project
*
* @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 <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module;
use Friendica\BaseModule;
/**
* Redirect to the friendica page
*/
class About extends BaseModule
{
protected function rawContent(array $request = [])
{
$this->baseUrl->redirect('friendica');
}
}

View File

@ -49,6 +49,8 @@ class Update extends BaseApi
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
$owner = User::getOwnerDataById($uid);
$request = self::getRequest([
'htmlstatus' => '',
'status' => '',
@ -59,10 +61,12 @@ class Update extends BaseApi
'media_ids' => '',
'source' => '',
'include_entities' => false,
'contact_allow' => $owner['allow_cid'],
'group_allow' => $owner['allow_gid'],
'contact_deny' => $owner['deny_cid'],
'group_deny' => $owner['deny_gid'],
], $request);
$owner = User::getOwnerDataById($uid);
if (!empty($request['htmlstatus'])) {
$body = HTML::toBBCodeVideo($request['htmlstatus']);
@ -96,10 +100,11 @@ class Update extends BaseApi
$item['coord'] = sprintf("%s %s", $request['lat'], $request['long']);
}
$item['allow_cid'] = $owner['allow_cid'] ?? '';
$item['allow_gid'] = $owner['allow_gid'] ?? '';
$item['deny_cid'] = $owner['deny_cid'] ?? '';
$item['deny_gid'] = $owner['deny_gid'] ?? '';
$aclFormatter = DI::aclFormatter();
$item['allow_cid'] = $aclFormatter->toString($request['contact_allow']);
$item['allow_gid'] = $aclFormatter->toString($request['group_allow']);
$item['deny_cid'] = $aclFormatter->toString($request['contact_deny']);
$item['deny_gid'] = $aclFormatter->toString($request['group_deny']);
if (!empty($item['allow_cid'] . $item['allow_gid'] . $item['deny_cid'] . $item['deny_gid'])) {
$item['private'] = Item::PRIVATE;

View File

@ -318,7 +318,7 @@ return [
'/proofs' => [Module\Api\Mastodon\Proofs::class, [R::GET ]], // Dummy, not supported
],
'/about[/more]' => [Module\Friendica::class, [R::GET]],
'/about[/more]' => [Module\About::class, [R::GET]],
'/admin' => [
'[/]' => [Module\Admin\Summary::class, [R::GET]],