mirror of
https://github.com/friendica/friendica
synced 2025-04-28 11:04:22 +02:00
Merge branch 'develop' into rewrite/gravity-constants
This commit is contained in:
commit
26e0469de7
181 changed files with 2408 additions and 2405 deletions
|
@ -170,7 +170,7 @@ class Processor
|
|||
}
|
||||
|
||||
/**
|
||||
* Stire attachment data
|
||||
* Store attachment data
|
||||
*
|
||||
* @param array $activity
|
||||
* @param array $item
|
||||
|
@ -187,7 +187,7 @@ class Processor
|
|||
}
|
||||
|
||||
/**
|
||||
* Store attachment data
|
||||
* Store question data
|
||||
*
|
||||
* @param array $activity
|
||||
* @param array $item
|
||||
|
@ -552,7 +552,7 @@ class Processor
|
|||
Logger::notice('Fetching is done by worker.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]);
|
||||
Fetch::add($activity['reply-to-id']);
|
||||
$activity['recursion-depth'] = 0;
|
||||
$wid = Worker::add(PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO);
|
||||
$wid = Worker::add(Worker::PRIORITY_HIGH, 'FetchMissingActivity', $activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO);
|
||||
Fetch::setWorkerId($activity['reply-to-id'], $wid);
|
||||
} else {
|
||||
Logger::debug('Activity will already be fetched via a worker.', ['url' => $activity['reply-to-id']]);
|
||||
|
@ -1665,9 +1665,9 @@ class Processor
|
|||
}
|
||||
if (DI::config()->get('system', 'bulk_delivery')) {
|
||||
Post\Delivery::add($post['uri-id'], $uid, $inbox, $post['created'], Delivery::POST, [$cid]);
|
||||
Worker::add(PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0);
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'APDelivery', '', 0, $inbox, 0);
|
||||
} else {
|
||||
Worker::add(PRIORITY_HIGH, 'APDelivery', Delivery::POST, $post['id'], $inbox, $uid, [$cid], $post['uri-id']);
|
||||
Worker::add(Worker::PRIORITY_HIGH, 'APDelivery', Delivery::POST, $post['id'], $inbox, $uid, [$cid], $post['uri-id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -652,7 +652,7 @@ class Receiver
|
|||
// We delay by 5 seconds to allow to accumulate all receivers
|
||||
$delayed = date(DateTimeFormat::MYSQL, time() + 5);
|
||||
Logger::debug('Initiate processing', ['id' => $object_data['entry-id'], 'uri' => $object_data['object_id']]);
|
||||
$wid = Worker::add(['priority' => PRIORITY_HIGH, 'delayed' => $delayed], 'ProcessQueue', $object_data['entry-id']);
|
||||
$wid = Worker::add(['priority' => Worker::PRIORITY_HIGH, 'delayed' => $delayed], 'ProcessQueue', $object_data['entry-id']);
|
||||
Queue::setWorkerId($object_data['entry-id'], $wid);
|
||||
} else {
|
||||
Logger::debug('Other queue entries need to be processed first.', ['id' => $object_data['entry-id']]);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace Friendica\Protocol\ActivityPub;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Cache\Enum\Duration;
|
||||
|
@ -40,6 +41,7 @@ use Friendica\Model\User;
|
|||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Protocol\Diaspora;
|
||||
use Friendica\Protocol\Relay;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
|
@ -415,7 +417,7 @@ class Transmitter
|
|||
{
|
||||
return [
|
||||
'type' => 'Service',
|
||||
'name' => FRIENDICA_PLATFORM . " '" . FRIENDICA_CODENAME . "' " . FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
|
||||
'name' => App::PLATFORM . " '" . App::CODENAME . "' " . App::VERSION . '-' . DB_UPDATE_VERSION,
|
||||
'url' => DI::baseUrl()->get()
|
||||
];
|
||||
}
|
||||
|
@ -1621,6 +1623,8 @@ class Transmitter
|
|||
|
||||
$permission_block = self::createPermissionBlockForItem($item, false);
|
||||
|
||||
$real_quote = false;
|
||||
|
||||
$body = $item['body'];
|
||||
|
||||
if ($type == 'Note') {
|
||||
|
@ -1662,10 +1666,17 @@ class Transmitter
|
|||
|
||||
$body = BBCode::setMentionsToNicknames($body);
|
||||
|
||||
$shared = BBCode::fetchShareAttributes($body);
|
||||
if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) {
|
||||
$body = self::replaceSharedData($body);
|
||||
$data['quoteUrl'] = $shared['link'];
|
||||
if (!empty($item['quote-uri']) && Post::exists(['uri-id' => $item['quote-uri-id'], 'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN]])) {
|
||||
$real_quote = true;
|
||||
if (Diaspora::isReshare($body, false)) {
|
||||
$body = BBCode::replaceSharedData($body);
|
||||
} elseif (strpos($body, $item['quote-uri']) === false) {
|
||||
$body .= "\n♲ " . $item['quote-uri'];
|
||||
}
|
||||
$data['quoteUrl'] = $item['quote-uri'];
|
||||
} elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) {
|
||||
$body .= "\n" . DI::contentItem()->createSharedPostByUriId($item['quote-uri-id'], $item['uid'], true);
|
||||
$item['body'] = Item::improveSharedDataInBody($item, true);
|
||||
}
|
||||
|
||||
$data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);
|
||||
|
@ -1678,9 +1689,11 @@ class Transmitter
|
|||
if (!empty($language)) {
|
||||
$richbody = BBCode::setMentionsToNicknames($item['body'] ?? '');
|
||||
|
||||
$shared = BBCode::fetchShareAttributes($richbody);
|
||||
if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) {
|
||||
$richbody = self::replaceSharedData($richbody);
|
||||
if ($real_quote) {
|
||||
$shared = BBCode::fetchShareAttributes($richbody);
|
||||
if (!empty($shared['link']) && !empty($shared['guid']) && !empty($shared['comment'])) {
|
||||
$richbody = BBCode::replaceSharedData($richbody);
|
||||
}
|
||||
}
|
||||
|
||||
$richbody = BBCode::removeAttachment($richbody);
|
||||
|
@ -1710,22 +1723,6 @@ class Transmitter
|
|||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the share block with a link
|
||||
*
|
||||
* @param string $body
|
||||
* @return string
|
||||
*/
|
||||
private static function replaceSharedData(string $body): string
|
||||
{
|
||||
return BBCode::convertShare(
|
||||
$body,
|
||||
function (array $attributes) {
|
||||
return '♲ ' . $attributes['link'];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the language from the post, the user or the system.
|
||||
*
|
||||
|
|
|
@ -25,6 +25,7 @@ use DOMDocument;
|
|||
use DOMElement;
|
||||
use DOMNode;
|
||||
use DOMXPath;
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
|
@ -369,8 +370,8 @@ class DFRN
|
|||
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
|
||||
XML::addElement($doc, $root, 'title', $owner['name']);
|
||||
|
||||
$attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION];
|
||||
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes);
|
||||
$attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION];
|
||||
XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
|
||||
|
||||
$attributes = ['rel' => 'license', 'href' => 'http://creativecommons.org/licenses/by/3.0/'];
|
||||
XML::addElement($doc, $root, 'link', '', $attributes);
|
||||
|
|
|
@ -2020,7 +2020,7 @@ class Diaspora
|
|||
}
|
||||
|
||||
Logger::info('Deliver participation', ['item' => $comment['id'], 'contact' => $author_contact['cid']]);
|
||||
if (Worker::add(PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['uri-id'], $author_contact['cid'], $datarray['uid'])) {
|
||||
if (Worker::add(Worker::PRIORITY_HIGH, 'Delivery', Delivery::POST, $comment['uri-id'], $author_contact['cid'], $datarray['uid'])) {
|
||||
Post\DeliveryData::incrementQueueCount($comment['uri-id'], 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,12 +24,14 @@ namespace Friendica\Protocol;
|
|||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMXPath;
|
||||
use Friendica\App;
|
||||
use Friendica\Content\PageInfo;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Cache\Enum\Duration;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
|
@ -631,7 +633,7 @@ class Feed
|
|||
unset($item['parent-uri']);
|
||||
|
||||
// Set the delivery priority for "remote self" to "medium"
|
||||
$notify = PRIORITY_MEDIUM;
|
||||
$notify = Worker::PRIORITY_MEDIUM;
|
||||
}
|
||||
|
||||
$condition = ['uid' => $item['uid'], 'uri' => $item['uri']];
|
||||
|
@ -1035,8 +1037,8 @@ class Feed
|
|||
break;
|
||||
}
|
||||
|
||||
$attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION];
|
||||
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes);
|
||||
$attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION];
|
||||
XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
|
||||
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
|
||||
XML::addElement($doc, $root, 'title', $title);
|
||||
XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename')));
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace Friendica\Protocol;
|
|||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use DOMXPath;
|
||||
use Friendica\App;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Cache\Enum\Duration;
|
||||
|
@ -1061,9 +1062,9 @@ class OStatus
|
|||
|
||||
$attributes = [
|
||||
'uri' => 'https://friendi.ca',
|
||||
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
|
||||
'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
|
||||
];
|
||||
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes);
|
||||
XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
|
||||
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
|
||||
XML::addElement($doc, $root, 'title', $title);
|
||||
XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename')));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue