From f406e01fcf7d69045cf3ad8ea8dea51acd85535b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 6 Dec 2016 18:03:30 +0100 Subject: Add filters for suspended accounts --- app/controllers/accounts_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/controllers/accounts_controller.rb') diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 46231dd97..57f25a273 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -5,6 +5,8 @@ class AccountsController < ApplicationController before_action :set_account before_action :set_link_headers + before_action :authenticate_user!, only: [:follow, :unfollow] + before_action :check_account_suspension def show respond_to do |format| @@ -50,4 +52,8 @@ class AccountsController < ApplicationController def webfinger_account_url webfinger_url(resource: "acct:#{@account.acct}@#{Rails.configuration.x.local_domain}") end + + def check_account_suspension + head 410 if @account.suspended? + end end -- cgit