diff --git a/app/controllers/ajax/list_controller.rb b/app/controllers/ajax/list_controller.rb index e934f497..c952cb59 100644 --- a/app/controllers/ajax/list_controller.rb +++ b/app/controllers/ajax/list_controller.rb @@ -95,6 +95,9 @@ class Ajax::ListController < AjaxController target_user = User.find_by_screen_name!(params[:user]) + raise Errors::ListingSelfBlockedOther if current_user.blocking?(target_user) + raise Errors::ListingOtherBlockedSelf if target_user.blocking?(current_user) + if add list.add_member target_user if list.members.find_by_user_id(target_user.id).nil? @response[:checked] = true diff --git a/lib/errors.rb b/lib/errors.rb index b577491e..10cb15cd 100644 --- a/lib/errors.rb +++ b/lib/errors.rb @@ -85,5 +85,11 @@ module Errors class ReactingOtherBlockedSelf < OtherBlockedSelf end + + class ListingSelfBlockedOther < SelfBlockedOther + end + + class ListingOtherBlockedSelf < OtherBlockedSelf + end # endregion end