From a47b1daaebea09ca07ca93079e530f26cfeef914 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sun, 5 May 2019 23:04:23 -0500 Subject: Implement scoped tags; use `local:` and `self:` scopes for community and personal tags, respectively. --- app/controllers/api/v1/accounts/statuses_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers/api') diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index 8a216ce0d..11661ce08 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -72,7 +72,9 @@ class Api::V1::Accounts::StatusesController < Api::BaseController tag = Tag.find_normalized(params[:tagged]) if tag - Status.tagged_with(tag.id) + return Status.none if !user_signed_in && (tag.local || tag.private) || tag.private && current_account.id != @account.id + scope = tag.private ? current_account.statuses : tag.local ? Status.local : Status + scope.tagged_with(tag.id) else Status.none end -- cgit