Skip to content

Commit

Permalink
Remove posts count and last posts from ActivityPub representation of …
Browse files Browse the repository at this point in the history
…hashtag collections (mastodon#23460)
  • Loading branch information
ClearlyClaire authored Feb 8, 2023
1 parent 08001e3 commit 832595d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions app/controllers/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TagsController < ApplicationController
before_action :authenticate_user!, if: :whitelist_mode?
before_action :set_local
before_action :set_tag
before_action :set_statuses
before_action :set_statuses, if: -> { request.format == :rss }
before_action :set_instance_presenter

skip_before_action :require_functional!, unless: :whitelist_mode?
Expand Down Expand Up @@ -44,12 +44,7 @@ def set_local
end

def set_statuses
case request.format&.to_sym
when :json
@statuses = cache_collection(TagFeed.new(@tag, current_account, local: @local).get(PAGE_SIZE, params[:max_id], params[:since_id], params[:min_id]), Status)
when :rss
@statuses = cache_collection(TagFeed.new(@tag, nil, local: @local).get(limit_param), Status)
end
@statuses = cache_collection(TagFeed.new(@tag, nil, local: @local).get(limit_param), Status)
end

def set_instance_presenter
Expand All @@ -64,8 +59,6 @@ def collection_presenter
ActivityPub::CollectionPresenter.new(
id: tag_url(@tag),
type: :ordered,
size: @tag.statuses.count,
items: @statuses.map { |status| ActivityPub::TagManager.instance.uri_for(status) }
)
end
end

0 comments on commit 832595d

Please sign in to comment.