forked from GNUsocial/gnu-social
[ActivityPub] Properly handle Actor URIs by using events correctly
This should fix nulls on explorer lookups inputed by postman after generate_followers/getSubscribers, that I think were caused by calling common_profile_uri that, curiously, only handles local profiles
This commit is contained in:
@@ -86,7 +86,7 @@ class Activitypub_profile extends Managed_DataObject
|
||||
*/
|
||||
public static function profile_to_array($profile)
|
||||
{
|
||||
$uri = ActivityPubPlugin::actor_uri($profile);
|
||||
$uri = $profile->getUri();
|
||||
$id = $profile->getID();
|
||||
$rsa = new Activitypub_rsa();
|
||||
$public_key = $rsa->ensure_public_key($profile);
|
||||
@@ -589,20 +589,16 @@ class Activitypub_profile extends Managed_DataObject
|
||||
}
|
||||
|
||||
$subs = Subscription::getSubscriberIDs($profile->id, $offset, $limit);
|
||||
try {
|
||||
$profiles = [];
|
||||
$profiles = [];
|
||||
|
||||
$users = User::multiGet('id', $subs);
|
||||
foreach ($users->fetchAll() as $user) {
|
||||
$profiles[$user->id] = $user->getProfile();
|
||||
}
|
||||
$users = User::multiGet('id', $subs);
|
||||
foreach ($users->fetchAll() as $user) {
|
||||
$profiles[$user->id] = $user->getProfile();
|
||||
}
|
||||
|
||||
$ap_profiles = Activitypub_profile::multiGet('profile_id', $subs);
|
||||
foreach ($ap_profiles->fetchAll() as $ap) {
|
||||
$profiles[$ap->getID()] = $ap->local_profile();
|
||||
}
|
||||
} catch (NoResultException $e) {
|
||||
return $e->obj;
|
||||
$ap_profiles = Activitypub_profile::multiGet('profile_id', $subs);
|
||||
foreach ($ap_profiles->fetchAll() as $ap) {
|
||||
$profiles[$ap->getID()] = $ap->local_profile();
|
||||
}
|
||||
|
||||
if ($cache) {
|
||||
|
@@ -115,7 +115,7 @@ class Activitypub_rsa extends Managed_DataObject
|
||||
// ASSERT: This should never happen, but try to recover!
|
||||
common_log(LOG_ERR, "Activitypub_rsa: An impossible thing has happened... Please let the devs know that it entered in line 116 at Activitypub_rsa.php");
|
||||
if ($fetch) {
|
||||
$res = Activitypub_explorer::get_remote_user_activity(ActivityPubPlugin::actor_uri($profile));
|
||||
$res = Activitypub_explorer::get_remote_user_activity($profile->getUri());
|
||||
Activitypub_rsa::update_public_key($profile, $res['publicKey']['publicKeyPem']);
|
||||
return self::ensure_public_key($profile, false);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user