[ActivityPub] Caching of Following/Followers interactions and collections

Follow interaction:
- Fixed mini-bug where the subscriber profile was being used as the subscribed
- Updated cache subscription-related values in both instances
- Tested and working with local GS instances

Unfollow interaction:
- Updated cache subscription-related values in both instances
- Tested and working with local GS instances

Followers/Following collections:
- Now returning ActivityPub profiles only
- Stored collections in cache

Misc:
- Fix bug concerning the retrieval of public/private-key after in-function generation
This commit is contained in:
brunoccast
2019-07-08 19:23:48 +01:00
committed by Diogo Cordeiro
parent 735a0023cc
commit 94a4059b4a
8 changed files with 219 additions and 18 deletions

View File

@@ -175,10 +175,14 @@ class Activitypub_inbox_handler
private function handle_accept_follow($actor, $object)
{
// Get valid Object profile
// Note that, since this an accept_follow, the $object
// profile is actually the actor that followed someone
$object_profile = new Activitypub_explorer;
$object_profile = $object_profile->lookup($object['object'])[0];
$pending_list = new Activitypub_pending_follow_requests($actor->getID(), $object_profile->getID());
Activitypub_profile::subscribeCacheUpdate($object_profile, $actor);
$pending_list = new Activitypub_pending_follow_requests($object_profile->getID(), $actor->getID());
$pending_list->remove();
}
@@ -302,7 +306,8 @@ class Activitypub_inbox_handler
if (Subscription::exists($actor, $object_profile)) {
Subscription::cancel($actor, $object_profile);
// You are no longer following this person.
// You are no longer following this person.
Activitypub_profile::unsubscribeCacheUpdate($actor, $object_profile);
} else {
// 409: You are not following this person already.
}