about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-07 21:40:49 +0200
committerThibaut Girka <thib@sitedethib.com>2018-07-09 19:19:23 +0200
commit402da8065c2b378cca6361f2c7252bd766f25dde (patch)
treeeda07c40c934ab9a55d7847afe4af3e54bce86b8 /app/controllers
parentee41947e9defce24ecd9f46329bb953d46b335bd (diff)
Migrate glitch-soc keyword mutes to Mastodon's
Completely remove glitch-soc's Keyword Mutes, migrate
existing database records to CustomFilters.

Handling of client-side filters is still not implemented
in the glitch-soc front-end.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings/keyword_mutes_controller.rb61
1 files changed, 0 insertions, 61 deletions
diff --git a/app/controllers/settings/keyword_mutes_controller.rb b/app/controllers/settings/keyword_mutes_controller.rb
deleted file mode 100644
index cf364a903..000000000
--- a/app/controllers/settings/keyword_mutes_controller.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-class Settings::KeywordMutesController < Settings::BaseController
-  before_action :load_keyword_mute, only: [:edit, :update, :destroy]
-
-  def index
-    @keyword_mutes = paginated_keyword_mutes_for_account
-  end
-
-  def new
-    @keyword_mute = keyword_mutes_for_account.build
-  end
-
-  def create
-    @keyword_mute = keyword_mutes_for_account.create(keyword_mute_params)
-
-    if @keyword_mute.persisted?
-      redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
-    else
-      render :new
-    end
-  end
-
-  def update
-    if @keyword_mute.update(keyword_mute_params)
-      redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
-    else
-      render :edit
-    end
-  end
-
-  def destroy
-    @keyword_mute.destroy!
-
-    redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
-  end
-
-  def destroy_all
-    keyword_mutes_for_account.delete_all
-
-    redirect_to settings_keyword_mutes_path, notice: I18n.t('generic.changes_saved_msg')
-  end
-
-  private
-
-  def keyword_mutes_for_account
-    Glitch::KeywordMute.where(account: current_account)
-  end
-
-  def load_keyword_mute
-    @keyword_mute = keyword_mutes_for_account.find(params[:id])
-  end
-
-  def keyword_mute_params
-    params.require(:keyword_mute).permit(:keyword, :whole_word, :apply_to_mentions)
-  end
-
-  def paginated_keyword_mutes_for_account
-    keyword_mutes_for_account.order(:keyword).page params[:page]
-  end
-end