logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 2db9ccaf3eeada3106e88e08163495ae8e741574
parent: cecf204bbbf9e5a296b4a6d28ffa1bbe27a741ed
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Thu, 31 Aug 2017 00:02:59 +0200

Add sharedInbox to actors (#4737)


Diffstat:

Mapp/controllers/activitypub/inboxes_controller.rb2+-
Mapp/serializers/activitypub/actor_serializer.rb9+++++++--
Mconfig/routes.rb2++
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/app/controllers/activitypub/inboxes_controller.rb b/app/controllers/activitypub/inboxes_controller.rb @@ -18,7 +18,7 @@ class ActivityPub::InboxesController < Api::BaseController private def set_account - @account = Account.find_local!(params[:account_username]) + @account = Account.find_local!(params[:account_username]) if params[:account_username] end def body diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb @@ -4,8 +4,9 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer include RoutingHelper attributes :id, :type, :following, :followers, - :inbox, :outbox, :preferred_username, - :name, :summary, :url + :inbox, :outbox, :shared_inbox, + :preferred_username, :name, :summary, + :url has_one :public_key, serializer: ActivityPub::PublicKeySerializer @@ -52,6 +53,10 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer account_outbox_url(object) end + def shared_inbox + inbox_url + end + def preferred_username object.username end diff --git a/config/routes.rb b/config/routes.rb @@ -56,6 +56,8 @@ Rails.application.routes.draw do resource :inbox, only: [:create], module: :activitypub end + resource :inbox, only: [:create], module: :activitypub + get '/@:username', to: 'accounts#show', as: :short_account get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies get '/@:username/media', to: 'accounts#show', as: :short_account_media