about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-02-24 22:18:10 -0800
committerReverite <github@reverite.sh>2019-02-24 22:18:10 -0800
commit54e480ca0939ba737f5abdf4ee861cd63c025865 (patch)
tree760cdd75fd0922266b60e784c06db99902ef5692 /app/controllers/api/v1/accounts
parentff9a09a9a7f73b558c53f334573b94198eb8d08a (diff)
parentd82de360c13894746d3974d11c9505c8937ebdee (diff)
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers/api/v1/accounts')
-rw-r--r--app/controllers/api/v1/accounts/statuses_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb
index 6c2a5c141..6fdc827cb 100644
--- a/app/controllers/api/v1/accounts/statuses_controller.rb
+++ b/app/controllers/api/v1/accounts/statuses_controller.rb
@@ -33,6 +33,7 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
     statuses.merge!(only_media_scope) if truthy_param?(:only_media)
     statuses.merge!(no_replies_scope) if truthy_param?(:exclude_replies)
     statuses.merge!(no_reblogs_scope) if truthy_param?(:exclude_reblogs)
+    statuses.merge!(hashtag_scope)    if params[:tagged].present?
 
     statuses
   end
@@ -67,6 +68,10 @@ class Api::V1::Accounts::StatusesController < Api::BaseController
     Status.without_reblogs
   end
 
+  def hashtag_scope
+    Status.tagged_with(Tag.find_by(name: params[:tagged])&.id)
+  end
+
   def pagination_params(core_params)
     params.slice(:limit, :only_media, :exclude_replies).permit(:limit, :only_media, :exclude_replies).merge(core_params)
   end