Merge remote-tracking branch 'upstream/2021.12-rc' into advanced-cleaned
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ class Item
|
||||
'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
|
||||
'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language',
|
||||
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
|
||||
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention',
|
||||
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global',
|
||||
'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
|
||||
'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type',
|
||||
'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network',
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
namespace Friendica\Module\Api\Twitter\Statuses;
|
||||
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
@@ -45,10 +44,12 @@ class Retweet extends BaseApi
|
||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||
$uid = self::getCurrentUserID();
|
||||
|
||||
$id = $request['id'] ?? 0;
|
||||
|
||||
if (empty($id)) {
|
||||
throw new BadRequestException('Item id not specified');
|
||||
if (!empty($this->parameters['id'])) {
|
||||
$id = (int)$this->parameters['id'];
|
||||
} elseif (!empty($request['id'])) {
|
||||
$id = (int)$request['id'];
|
||||
} else {
|
||||
throw new BadRequestException('An id is missing.');
|
||||
}
|
||||
|
||||
$fields = ['uri-id', 'network', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink'];
|
||||
|
||||
+4
-2
@@ -135,8 +135,6 @@ class Post
|
||||
*/
|
||||
public function getTemplateData(array $conv_responses, string $formSecurityToken, $thread_level = 1)
|
||||
{
|
||||
$a = DI::app();
|
||||
|
||||
$item = $this->getData();
|
||||
$edited = false;
|
||||
// If the time between "created" and "edited" differs we add
|
||||
@@ -177,6 +175,8 @@ class Post
|
||||
? DI::l10n()->t('Private Message')
|
||||
: false);
|
||||
|
||||
$connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false;
|
||||
|
||||
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE;
|
||||
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
|
||||
|
||||
@@ -469,6 +469,7 @@ class Post
|
||||
'app' => $item['app'],
|
||||
'created' => $ago,
|
||||
'lock' => $lock,
|
||||
'connector' => $connector,
|
||||
'location_html' => $location_html,
|
||||
'indent' => $indent,
|
||||
'shiny' => $shiny,
|
||||
@@ -477,6 +478,7 @@ class Post
|
||||
'owner_photo' => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['owner-link'], $item['uid'], Proxy::SIZE_THUMB)),
|
||||
'owner_name' => $this->getOwnerName(),
|
||||
'plink' => Item::getPlink($item),
|
||||
'browsershare' => DI::l10n()->t('Share'),
|
||||
'edpost' => $edpost,
|
||||
'ispinned' => $ispinned,
|
||||
'pin' => $pin,
|
||||
|
||||
Reference in New Issue
Block a user