mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Remove obsolete per topic unsubscribe page.
This commit is contained in:
@ -38,7 +38,7 @@ class TopicsController < ApplicationController
|
||||
|
||||
before_action :consider_user_for_promotion, only: :show
|
||||
|
||||
skip_before_action :check_xhr, only: [:show, :unsubscribe, :feed]
|
||||
skip_before_action :check_xhr, only: [:show, :feed]
|
||||
|
||||
def id_for_slug
|
||||
topic = Topic.find_by(slug: params[:slug].downcase)
|
||||
@ -154,30 +154,6 @@ class TopicsController < ApplicationController
|
||||
render_serialized(topic.reload, BasicTopicSerializer)
|
||||
end
|
||||
|
||||
def unsubscribe
|
||||
if current_user.blank?
|
||||
cookies[:destination_url] = request.fullpath
|
||||
return redirect_to "/login-preferences"
|
||||
end
|
||||
|
||||
@topic_view = TopicView.new(params[:topic_id], current_user)
|
||||
|
||||
if slugs_do_not_match || (!request.format.json? && params[:slug].blank?)
|
||||
return redirect_to @topic_view.topic.unsubscribe_url, status: 301
|
||||
end
|
||||
|
||||
tu = TopicUser.find_by(user_id: current_user.id, topic_id: params[:topic_id])
|
||||
|
||||
if tu && tu.notification_level > TopicUser.notification_levels[:regular]
|
||||
tu.notification_level = TopicUser.notification_levels[:regular]
|
||||
tu.save!
|
||||
else
|
||||
TopicUser.change(current_user.id, params[:topic_id].to_i, notification_level: TopicUser.notification_levels[:muted])
|
||||
end
|
||||
|
||||
perform_show_response
|
||||
end
|
||||
|
||||
def wordpress
|
||||
params.require(:best)
|
||||
params.require(:topic_id)
|
||||
|
Reference in New Issue
Block a user