Add sharedInbox to actors (#4737)
This commit is contained in:
		
							parent
							
								
									cecf204bbb
								
							
						
					
					
						commit
						2db9ccaf3e
					
				
					 3 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -18,7 +18,7 @@ class ActivityPub::InboxesController < Api::BaseController
 | 
				
			||||||
  private
 | 
					  private
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def set_account
 | 
					  def set_account
 | 
				
			||||||
    @account = Account.find_local!(params[:account_username])
 | 
					    @account = Account.find_local!(params[:account_username]) if params[:account_username]
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def body
 | 
					  def body
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,9 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
 | 
				
			||||||
  include RoutingHelper
 | 
					  include RoutingHelper
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  attributes :id, :type, :following, :followers,
 | 
					  attributes :id, :type, :following, :followers,
 | 
				
			||||||
             :inbox, :outbox, :preferred_username,
 | 
					             :inbox, :outbox, :shared_inbox,
 | 
				
			||||||
             :name, :summary, :url
 | 
					             :preferred_username, :name, :summary,
 | 
				
			||||||
 | 
					             :url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  has_one :public_key, serializer: ActivityPub::PublicKeySerializer
 | 
					  has_one :public_key, serializer: ActivityPub::PublicKeySerializer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,6 +53,10 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
 | 
				
			||||||
    account_outbox_url(object)
 | 
					    account_outbox_url(object)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  def shared_inbox
 | 
				
			||||||
 | 
					    inbox_url
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def preferred_username
 | 
					  def preferred_username
 | 
				
			||||||
    object.username
 | 
					    object.username
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,6 +56,8 @@ Rails.application.routes.draw do
 | 
				
			||||||
    resource :inbox, only: [:create], module: :activitypub
 | 
					    resource :inbox, only: [:create], module: :activitypub
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  resource :inbox, only: [:create], module: :activitypub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get '/@:username', to: 'accounts#show', as: :short_account
 | 
					  get '/@:username', to: 'accounts#show', as: :short_account
 | 
				
			||||||
  get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies
 | 
					  get '/@:username/with_replies', to: 'accounts#show', as: :short_account_with_replies
 | 
				
			||||||
  get '/@:username/media', to: 'accounts#show', as: :short_account_media
 | 
					  get '/@:username/media', to: 'accounts#show', as: :short_account_media
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue