aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-09-21 06:14:24 +0000
committerMario <mario@mariovavti.com>2023-09-21 06:14:24 +0000
commit9627c3e7c850b3532c3840910c0862f093cd8fb1 (patch)
treea5ddc93a8d8244e9ba4e03c31416bbaa93017db4 /Zotlabs/Lib
parentd88c67eba37569a95691bc967046eed318e39b46 (diff)
downloadvolse-hubzilla-9627c3e7c850b3532c3840910c0862f093cd8fb1.tar.gz
volse-hubzilla-9627c3e7c850b3532c3840910c0862f093cd8fb1.tar.bz2
volse-hubzilla-9627c3e7c850b3532c3840910c0862f093cd8fb1.zip
store the actor cache date so we can easily invalidate it after a period of time
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index cc0ac547c..9b94c4d8d 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -142,6 +142,7 @@ class Activity {
logger('returned: ' . json_encode($y, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), LOGGER_DEBUG);
if (isset($y['type']) && ActivityStreams::is_an_actor($y['type'])) {
+ $y['actor_cache_date'] = datetime_convert();
XConfig::Set($y['id'], 'system', 'actor_record', $y);
}
@@ -1668,11 +1669,6 @@ class Activity {
return;
}
- // store the actor record in XConfig
-
- // we already store this in Activity::fetch()
- // XConfig::Set($url, 'system', 'actor_record', $person_obj);
-
$name = $person_obj['name'] ?? '';
if (!$name) {
$name = $person_obj['preferredUsername'] ?? '';
@@ -4033,7 +4029,8 @@ class Activity {
$cache_url = ((strpos($id, '#')) ? substr($id, 0, strpos($id, '#')) : $id);
$actor = XConfig::Get($cache_url, 'system', 'actor_record');
- if ($actor) {
+ if ($actor && isset($actor['actor_cache_date']) && $actor['actor_cache_date'] > datetime_convert('UTC', 'UTC', ' now - 3 days')) {
+ unset($actor['actor_cache_date']);
return $actor;
}