about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/accounts_controller.rb2
-rw-r--r--app/views/accounts/show.activitystreams2.rabl8
-rw-r--r--app/views/activitypub/base.activitystreams2.rabl1
-rw-r--r--app/views/activitypub/intransient.activitystreams2.rabl3
-rw-r--r--app/views/activitypub/types/person.activitystreams2.rabl3
5 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb
index 411a41ccc..b837f006e 100644
--- a/app/controllers/accounts_controller.rb
+++ b/app/controllers/accounts_controller.rb
@@ -18,6 +18,8 @@ class AccountsController < ApplicationController
       format.atom do
         @entries = @account.stream_entries.order('id desc').where(hidden: false).with_includes.paginate_by_max_id(20, params[:max_id], params[:since_id])
       end
+
+      format.activitystreams2
     end
   end
 
diff --git a/app/views/accounts/show.activitystreams2.rabl b/app/views/accounts/show.activitystreams2.rabl
new file mode 100644
index 000000000..dabae3f29
--- /dev/null
+++ b/app/views/accounts/show.activitystreams2.rabl
@@ -0,0 +1,8 @@
+extends 'activitypub/types/person.activitystreams2.rabl'
+
+object @account
+
+attributes display_name: :name, username: :preferredUsername, note: :summary
+
+node(:icon)   { |account| full_asset_url(account.avatar.url(:original)) }
+node(:image)  { |account| full_asset_url(account.header.url(:original)) }
diff --git a/app/views/activitypub/base.activitystreams2.rabl b/app/views/activitypub/base.activitystreams2.rabl
new file mode 100644
index 000000000..c5e94997a
--- /dev/null
+++ b/app/views/activitypub/base.activitystreams2.rabl
@@ -0,0 +1 @@
+node(:'@context') { 'https://www.w3.org/ns/activitystreams' }
diff --git a/app/views/activitypub/intransient.activitystreams2.rabl b/app/views/activitypub/intransient.activitystreams2.rabl
new file mode 100644
index 000000000..968e451c2
--- /dev/null
+++ b/app/views/activitypub/intransient.activitystreams2.rabl
@@ -0,0 +1,3 @@
+extends 'activitypub/base.activitystreams2.rabl'
+
+node(:id) { request.original_url }
diff --git a/app/views/activitypub/types/person.activitystreams2.rabl b/app/views/activitypub/types/person.activitystreams2.rabl
new file mode 100644
index 000000000..487a60791
--- /dev/null
+++ b/app/views/activitypub/types/person.activitystreams2.rabl
@@ -0,0 +1,3 @@
+extends 'activitypub/intransient.activitystreams2.rabl'
+
+node(:type) { 'Person' }