[ActivityPub] Ensuring federation with other software

ActivityPubPlugin:
- Prevent sending a Delete for an Announce

Activitypub_announce:
- Update announce_to_array to add id, to and cc information to the retrieved object

Activitypub_follow:
- Add id to the arguments of follow_to_array, useful for Accept-Follow activities

Activitypub_notice:
- Fix notice validation, url isn't a MUST

Activitypub_inbox_handler:
- Make handle_follow use the received activity id for the later Accept-Follow

Activitypub_postman:
- Fix call to the updated announce_to_array
- Fix successive unnecessary calls to ActivityPubPlugin::actor_uri()
This commit is contained in:
tenma
2019-08-05 23:22:32 +01:00
committed by Diogo Cordeiro
parent 14a45dc546
commit c28cee88b7
6 changed files with 53 additions and 39 deletions

View File

@@ -129,7 +129,7 @@ class Activitypub_inbox_handler
$this->handle_delete($this->actor, $this->object);
break;
case 'Follow':
$this->handle_follow($this->actor, $this->object);
$this->handle_follow($this->actor, $this->activity);
break;
case 'Like':
$this->handle_like($this->actor, $this->object);
@@ -232,7 +232,7 @@ class Activitypub_inbox_handler
* Handles a Follow Activity received by our inbox.
*
* @param Profile $actor Actor
* @param array $object Activity
* @param array $activity Activity
* @throws AlreadyFulfilledException
* @throws HTTP_Request2_Exception
* @throws NoProfileException
@@ -241,9 +241,9 @@ class Activitypub_inbox_handler
* @throws \HttpSignatures\Exception
* @author Diogo Cordeiro <diogo@fc.up.pt>
*/
private function handle_follow($actor, $object)
private function handle_follow($actor, $activity)
{
Activitypub_follow::follow($actor, $object);
Activitypub_follow::follow($actor, $activity['object'], $activity['id']);
}
/**