From 347a153b3dc73068aedf7510c395cc350a553629 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 6 Feb 2017 23:16:20 +0100 Subject: Add API modifiers to limit returned toots from public/hashtag timelines to only those from local users; Add link to "extended information" to getting started in the UI; Add defaults for posting privacy; Change how publish button looks depending on posting privacy chosen --- app/controllers/settings/preferences_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'app/controllers/settings/preferences_controller.rb') diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 5ad825675..40888963e 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -21,7 +21,9 @@ class Settings::PreferencesController < ApplicationController must_be_following: user_params[:interactions][:must_be_following] == '1', } - if current_user.update(user_params.except(:notification_emails, :interactions)) + current_user.settings['default_privacy'] = user_params[:settings][:default_privacy] + + if current_user.update(user_params.except(:notification_emails, :interactions, :settings)) redirect_to settings_preferences_path, notice: I18n.t('generic.changes_saved_msg') else render action: :show @@ -31,6 +33,6 @@ class Settings::PreferencesController < ApplicationController private def user_params - params.require(:user).permit(:locale, notification_emails: [:follow, :follow_request, :reblog, :favourite, :mention], interactions: [:must_be_follower, :must_be_following]) + params.require(:user).permit(:locale, settings: [:default_privacy], notification_emails: [:follow, :follow_request, :reblog, :favourite, :mention], interactions: [:must_be_follower, :must_be_following]) end end -- cgit