From 4b229e11d875d1a57a381eeb1a5d9ec9f72ec503 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Fri, 24 Jul 2020 04:38:43 -0500 Subject: [Command Tags] Preload statement handlers --- app/lib/command_tag/commands/hello_world.rb | 2 +- app/lib/command_tag/commands/parent_status_tools.rb | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'app/lib/command_tag/commands') diff --git a/app/lib/command_tag/commands/hello_world.rb b/app/lib/command_tag/commands/hello_world.rb index 4cf17685e..581b21317 100644 --- a/app/lib/command_tag/commands/hello_world.rb +++ b/app/lib/command_tag/commands/hello_world.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module CommandTag::Commands::HelloWorld - def handle_hello_world_at_start + def handle_hello_world_at_start(_) @text << "\nHello, world!" end end diff --git a/app/lib/command_tag/commands/parent_status_tools.rb b/app/lib/command_tag/commands/parent_status_tools.rb index df3cd06c6..ab917e8f5 100644 --- a/app/lib/command_tag/commands/parent_status_tools.rb +++ b/app/lib/command_tag/commands/parent_status_tools.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true - -# rubocop:disable Layout/ExtraSpacing module CommandTag::Commands::ParentStatusTools - def handle_publish_once_at_end + def handle_publish_once_at_end(_) return unless author_of_parent? && !@parent.published? PublishStatusService.new.call(@parent) @@ -13,7 +11,7 @@ module CommandTag::Commands::ParentStatusTools alias handle_publish_toot_once_at_end handle_publish_once_at_end alias handle_publish_parent_once_at_end handle_publish_once_at_end - def handle_edit_once_before_save + def handle_edit_once_before_save(_) return unless author_of_parent? params = @parent.slice(*UpdateStatusService::ALLOWED_ATTRIBUTES).with_indifferent_access.compact @@ -27,7 +25,7 @@ module CommandTag::Commands::ParentStatusTools alias handle_edit_toot_once_before_save handle_edit_once_before_save alias handle_edit_parent_once_before_save handle_edit_once_before_save - def handle_mute_once_at_end + def handle_mute_once_at_end(_) return if author_of_parent? MuteStatusService.new.call(@account, @parent) @@ -43,7 +41,7 @@ module CommandTag::Commands::ParentStatusTools alias handle_hide_toot_once_at_end handle_mute_once_at_end alias handle_hide_parent_once_at_end handle_mute_once_at_end - def handle_unmute_once_at_end + def handle_unmute_once_at_end(_) return if author_of_parent? @account.unmute_status!(@parent) @@ -59,7 +57,7 @@ module CommandTag::Commands::ParentStatusTools alias handle_unhide_toot_once_at_end handle_unmute_once_at_end alias handle_unhide_parent_once_at_end handle_unmute_once_at_end - def handle_mute_thread_once_at_end + def handle_mute_thread_once_at_end(_) return if author_of_parent? MuteConversationService.new.call(@account, @conversation) @@ -69,7 +67,7 @@ module CommandTag::Commands::ParentStatusTools alias handle_hide_thread_once_at_end handle_mute_thread_once_at_end alias handle_hide_conversation_once_at_end handle_mute_thread_once_at_end - def handle_unmute_thread_once_at_end + def handle_unmute_thread_once_at_end(_) return if author_of_parent? || @conversation.blank? @account.unmute_conversation!(@conversation) @@ -79,4 +77,3 @@ module CommandTag::Commands::ParentStatusTools alias handle_unhide_thread_once_at_end handle_unmute_thread_once_at_end alias handle_unhide_conversation_once_at_end handle_unmute_thread_once_at_end end -# rubocop:enable Layout/ExtraSpacing -- cgit