Merge commit 'b9f59ebcc68e9da0a7158741a1a2ef3564e1321e' into merging-upstream

This commit is contained in:
Ondřej Hruška
2017-09-28 09:18:35 +02:00
4750 changed files with 5257 additions and 3475 deletions

View File

@ -3,7 +3,7 @@
module Admin
class CustomEmojisController < BaseController
def index
@custom_emojis = CustomEmoji.where(domain: nil)
@custom_emojis = CustomEmoji.local
end
def new

View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
class Api::V1::CustomEmojisController < Api::BaseController
respond_to :json
def index
render json: CustomEmoji.local, each_serializer: REST::CustomEmojiSerializer
end
end

View File

@ -17,12 +17,29 @@ class FollowerAccountsController < ApplicationController
private
def page_url(page)
account_followers_url(@account, page: page) unless page.nil?
end
def collection_presenter
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account),
page = ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account, page: params.fetch(:page, 1)),
type: :ordered,
size: @account.followers_count,
items: @follows.map { |f| ActivityPub::TagManager.instance.uri_for(f.account) }
items: @follows.map { |f| ActivityPub::TagManager.instance.uri_for(f.account) },
part_of: account_followers_url(@account),
next: page_url(@follows.next_page),
prev: page_url(@follows.prev_page)
)
if params[:page].present?
page
else
ActivityPub::CollectionPresenter.new(
id: account_followers_url(@account),
type: :ordered,
size: @account.followers_count,
first: page
)
end
end
end

View File

@ -17,12 +17,29 @@ class FollowingAccountsController < ApplicationController
private
def page_url(page)
account_following_index_url(@account, page: page) unless page.nil?
end
def collection_presenter
ActivityPub::CollectionPresenter.new(
id: account_following_index_url(@account),
page = ActivityPub::CollectionPresenter.new(
id: account_following_index_url(@account, page: params.fetch(:page, 1)),
type: :ordered,
size: @account.following_count,
items: @follows.map { |f| ActivityPub::TagManager.instance.uri_for(f.target_account) }
items: @follows.map { |f| ActivityPub::TagManager.instance.uri_for(f.target_account) },
part_of: account_following_index_url(@account),
next: page_url(@follows.next_page),
prev: page_url(@follows.prev_page)
)
if params[:page].present?
page
else
ActivityPub::CollectionPresenter.new(
id: account_following_index_url(@account),
type: :ordered,
size: @account.following_count,
first: page
)
end
end
end