mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-25 01:24:02 -05:00
fbef909c2a
* Add option to block direct messages from people you don't follow Fix #5326 * If the DM responds to a toot by recipient, allow it through * i18n: Update Polish translation (for #5669) (#5673)
33 lines
717 B
Ruby
33 lines
717 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::NotificationsController < ApplicationController
|
|
layout 'admin'
|
|
|
|
before_action :authenticate_user!
|
|
|
|
def show; end
|
|
|
|
def update
|
|
user_settings.update(user_settings_params.to_h)
|
|
|
|
if current_user.save
|
|
redirect_to settings_notifications_path, notice: I18n.t('generic.changes_saved_msg')
|
|
else
|
|
render :show
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def user_settings
|
|
UserSettingsDecorator.new(current_user)
|
|
end
|
|
|
|
def user_settings_params
|
|
params.require(:user).permit(
|
|
notification_emails: %i(follow follow_request reblog favourite mention digest),
|
|
interactions: %i(must_be_follower must_be_following must_be_following_dm)
|
|
)
|
|
end
|
|
end
|