about summary refs log tree commit diff
path: root/app/controllers/activitypub/follows_controller.rb
diff options
context:
space:
mode:
authorJenkins <jenkins@jenkins.ninjawedding.org>2018-01-03 20:17:13 +0000
committerJenkins <jenkins@jenkins.ninjawedding.org>2018-01-03 20:17:13 +0000
commitfc884d015a1a2d6c31976af3d63039390fa15939 (patch)
tree0cb950fd716f3f2cb9f13348cf42fb6e4bc8b909 /app/controllers/activitypub/follows_controller.rb
parent933840bebf4ce8f5282c88e8c3e8c1b3675fbf2d (diff)
parentd907d4352e9b6cb22bc1fabd42ca3fc60aef8a37 (diff)
Merge remote-tracking branch 'tootsuite/master' into glitchsoc/master
Diffstat (limited to 'app/controllers/activitypub/follows_controller.rb')
-rw-r--r--app/controllers/activitypub/follows_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/activitypub/follows_controller.rb b/app/controllers/activitypub/follows_controller.rb
new file mode 100644
index 000000000..8b1cddeb4
--- /dev/null
+++ b/app/controllers/activitypub/follows_controller.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class ActivityPub::FollowsController < Api::BaseController
+  include SignatureVerification
+
+  def show
+    render(
+      json: FollowRequest.includes(:account).references(:account).find_by!(
+        id: params.require(:id),
+        accounts: { domain: nil, username: params.require(:account_username) },
+        target_account: signed_request_account
+      ),
+      serializer: ActivityPub::FollowSerializer,
+      adapter: ActivityPub::Adapter,
+      content_type: 'application/activity+json'
+    )
+  end
+end