mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Compare commits
1 Commits
v4.3.0-bet
...
feature/ke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
307a8dfad0 |
@@ -1,10 +1,13 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Settings::KeywordMutesController < ApplicationController
|
class Settings::KeywordMutesController < ApplicationController
|
||||||
|
include UserTrackingConcern
|
||||||
|
|
||||||
layout 'admin'
|
layout 'admin'
|
||||||
|
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
before_action :load_keyword_mute, only: [:edit, :update, :destroy]
|
before_action :load_keyword_mute, only: [:edit, :update, :destroy]
|
||||||
|
after_action :bust_feed_caches, only: [:create, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@keyword_mutes = paginated_keyword_mutes_for_account
|
@keyword_mutes = paginated_keyword_mutes_for_account
|
||||||
@@ -54,6 +57,12 @@ class Settings::KeywordMutesController < ApplicationController
|
|||||||
@keyword_mute = keyword_mutes_for_account.find(params[:id])
|
@keyword_mute = keyword_mutes_for_account.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bust_feed_caches
|
||||||
|
# FIXME: this key is really meant to be an implementation detail
|
||||||
|
Redis.current.del("account:#{current_user.account_id}:regeneration")
|
||||||
|
regenerate_feed!
|
||||||
|
end
|
||||||
|
|
||||||
def keyword_mute_params
|
def keyword_mute_params
|
||||||
params.require(:keyword_mute).permit(:keyword, :whole_word)
|
params.require(:keyword_mute).permit(:keyword, :whole_word)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user