From 46b8db53ab021be06f6dd9c15e6b69c22609aa0f Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Sep 2021 10:59:16 +0000 Subject: provide a get_cached_actor_provider hook and improve the author/owner handling in Libzot::import() --- Zotlabs/Lib/Activity.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Lib/Activity.php') diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 62a22f70e..a0a9a7c7f 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3548,7 +3548,21 @@ class Activity { } static function get_cached_actor($id) { - return (XConfig::Get($id,'system','actor_record')); + $actor = XConfig::Get($id,'system', 'actor_record'); + + if ($actor) { + return $actor; + } + + // try other get_cached_actor providers (e.g. diaspora) + $hookdata = [ + 'id' => $id, + 'actor' => false + ]; + + call_hooks('get_cached_actor_provider', $hookdata); + + return $hookdata['actor']; } static function get_actor_hublocs($url, $options = 'all') { -- cgit v1.2.3