Commit 347e3c60 authored by swentel's avatar swentel

Issue #3176340: use 202

parent 6422b80b
......@@ -7,8 +7,8 @@ come.
The module has been tested with the following federated platforms:
- Mastodon: follow/accept, post notes (with image), reply
- Pleroma: follow/accept, post notes, reply
- Mastodon: follow/accept, post articles/notes (with image), reply
- Pleroma: follow/accept, post articles/notes (with image), reply
- Pixelfed: follow/accept, post photos, reply
Open an issue if you have successfully interacted with another platform!
......
......@@ -111,7 +111,7 @@ class InboxController extends BaseController {
$activity = $storage->create($values);
$activity->save();
$status = 201;
$status = 202;
}
else {
$status = 403;
......
......@@ -36,7 +36,7 @@ class ActivityTest extends ActivityPubTestBase {
];
$inbox = Url::fromRoute('activitypub.inbox', ['user' => $this->authenticatedUserTwo->id(), 'activitypub_actor' => $this->accountNameTwo])->toString();
$response = $this->sendInboxRequest($inbox, $payload);
self::assertEquals(201, $response->getStatusCode());
self::assertEquals(202, $response->getStatusCode());
/** @var \Drupal\activitypub\Entity\Storage\ActivityPubActorStorageInterface $storage */
$storage = \Drupal::entityTypeManager()->getStorage('activitypub_activity');
......@@ -115,7 +115,7 @@ class ActivityTest extends ActivityPubTestBase {
'object' => $object_href,
];
$response = $this->sendInboxRequest($inbox, $payload);
self::assertEquals(201, $response->getStatusCode());
self::assertEquals(202, $response->getStatusCode());
$activity = $storage->load(3);
self::assertEquals("Follow", $activity->getType());
self::assertEquals($payload['actor'], $activity->getActor());
......@@ -146,7 +146,7 @@ class ActivityTest extends ActivityPubTestBase {
'object' => $object_href,
];
$response = $this->sendInboxRequest($inbox, $payload);
self::assertEquals(201, $response->getStatusCode());
self::assertEquals(202, $response->getStatusCode());
// Get followers of account 2.
$this->drupalGet('user/' . $this->authenticatedUserTwo->id() . '/activitypub/' . $this->accountNameTwo . '/followers', ['query' => ['page' => 0]]);
......@@ -168,7 +168,7 @@ class ActivityTest extends ActivityPubTestBase {
'object' => 'https://mastodon.social/user/deleted',
];
$response = $this->sendInboxRequest($inbox, $payload);
self::assertEquals(201, $response->getStatusCode());
self::assertEquals(202, $response->getStatusCode());
$ids = $storage->getQuery()->condition('uid', $this->authenticatedUserTwo->id())->execute();
self::assertEquals(4, count($ids));
}
......
......@@ -108,7 +108,7 @@ class CommentTest extends ActivityPubTestBase {
];
$inbox = Url::fromRoute('activitypub.inbox', ['user' => $this->authenticatedUserTwo->id(), 'activitypub_actor' => $this->accountNameTwo])->toString();
$response = $this->sendInboxRequest($inbox, $payload);
self::assertEquals(201, $response->getStatusCode());
self::assertEquals(202, $response->getStatusCode());
/** @var \Drupal\activitypub\Entity\Storage\ActivityPubActorStorageInterface $activityStorage */
$activityStorage = \Drupal::entityTypeManager()->getStorage('activitypub_activity');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment