mirror of
https://github.com/friendica/friendica
synced 2025-04-22 06:30:11 +00:00
Caching for fetched activities
This commit is contained in:
parent
f29d9be574
commit
d12c9a8f58
3 changed files with 35 additions and 22 deletions
|
@ -241,7 +241,7 @@ class Receiver
|
|||
return 'as:' . $profile['type'];
|
||||
}
|
||||
|
||||
$data = ActivityPub::fetchContent($object_id, $uid);
|
||||
$data = Processor::fetchCachedActivity($object_id, $uid);
|
||||
if (!empty($data)) {
|
||||
$object = JsonLD::compact($data);
|
||||
$type = JsonLD::fetchElement($object, '@type');
|
||||
|
@ -284,7 +284,7 @@ class Receiver
|
|||
if (!empty($id) && !$trust_source) {
|
||||
$fetch_uid = $uid ?: self::getBestUserForActivity($activity);
|
||||
|
||||
$fetched_activity = ActivityPub::fetchContent($fetch_id, $fetch_uid);
|
||||
$fetched_activity = Processor::fetchCachedActivity($fetch_id, $fetch_uid);
|
||||
if (!empty($fetched_activity)) {
|
||||
$object = JsonLD::compact($fetched_activity);
|
||||
|
||||
|
@ -358,7 +358,7 @@ class Receiver
|
|||
|
||||
// Fetch the activity on Lemmy "Announce" messages (announces of activities)
|
||||
if (($type == 'as:Announce') && in_array($object_type, array_merge(self::ACTIVITY_TYPES, ['as:Delete', 'as:Undo', 'as:Update']))) {
|
||||
$data = ActivityPub::fetchContent($object_id, $fetch_uid);
|
||||
$data = Processor::fetchCachedActivity($object_id, $fetch_uid);
|
||||
if (!empty($data)) {
|
||||
$type = $object_type;
|
||||
$activity = JsonLD::compact($data);
|
||||
|
@ -1273,7 +1273,7 @@ class Receiver
|
|||
$type = JsonLD::fetchElement($object, '@type');
|
||||
|
||||
if (!$trust_source || empty($type)) {
|
||||
$data = ActivityPub::fetchContent($object_id, $uid);
|
||||
$data = Processor::fetchCachedActivity($object_id, $uid);
|
||||
if (!empty($data)) {
|
||||
$object = JsonLD::compact($data);
|
||||
Logger::info('Fetched content for ' . $object_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue