about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-03-31 21:37:57 +0200
committerClaire <claire.github-309c@sitedethib.com>2023-03-31 22:50:57 +0200
commit3dcba94e68889f3d6603fa5416d54edd08dcf4bd (patch)
treefdcfb11945858d17d2a3998eee99daa2cc800e64 /app/models
parent01d6f7529faef97c0209ef11bbca2e856961bbab (diff)
Migrate glitch-soc's exclusive user settings
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/has_user_settings.rb36
-rw-r--r--app/models/user_settings.rb9
2 files changed, 42 insertions, 3 deletions
diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/has_user_settings.rb
index b3fa1f683..0e9d4e1cd 100644
--- a/app/models/concerns/has_user_settings.rb
+++ b/app/models/concerns/has_user_settings.rb
@@ -39,6 +39,10 @@ module HasUserSettings
     settings['web.delete_modal']
   end
 
+  def setting_favourite_modal
+    settings['web.favourite_modal']
+  end
+
   def setting_reduce_motion
     settings['web.reduce_motion']
   end
@@ -47,12 +51,20 @@ module HasUserSettings
     settings['web.use_system_font']
   end
 
+  def setting_system_emoji_font
+    settings['web.use_system_emoji_font']
+  end
+
   def setting_noindex
     settings['noindex']
   end
 
-  def setting_theme
-    settings['theme']
+  def setting_flavour
+    settings['flavour']
+  end
+
+  def setting_skin
+    settings['skin']
   end
 
   def setting_display_media
@@ -107,6 +119,14 @@ module HasUserSettings
     settings['default_privacy'] || (account.locked? ? 'private' : 'public')
   end
 
+  def setting_default_content_type
+    settings['default_content_type']
+  end
+
+  def setting_hide_followers_count
+    settings['hide_followers_count']
+  end
+
   def allows_report_emails?
     settings['notification_emails.report']
   end
@@ -123,6 +143,18 @@ module HasUserSettings
     settings['notification_emails.trends']
   end
 
+  def allows_trending_tags_review_emails?
+    settings['notification_emails.trends']
+  end
+
+  def allows_trending_links_review_emails?
+    settings['notification_emails.link_trends']
+  end
+
+  def allows_trending_statuses_review_emails?
+    settings['notification_emails.status_trends']
+  end
+
   def aggregates_reblogs?
     settings['aggregate_reblogs']
   end
diff --git a/app/models/user_settings.rb b/app/models/user_settings.rb
index 2c025d6c5..0be8c5fbc 100644
--- a/app/models/user_settings.rb
+++ b/app/models/user_settings.rb
@@ -9,12 +9,15 @@ class UserSettings
 
   setting :always_send_emails, default: false
   setting :aggregate_reblogs, default: true
-  setting :theme, default: -> { ::Setting.theme }
+  setting :flavour, default: -> { ::Setting.flavour }
+  setting :skin, default: -> { ::Setting.skin }
   setting :noindex, default: -> { ::Setting.noindex }
   setting :show_application, default: true
   setting :default_language, default: nil
   setting :default_sensitive, default: false
   setting :default_privacy, default: nil
+  setting :default_content_type, default: 'text/plain'
+  setting :hide_followers_count, default: false
 
   namespace :web do
     setting :crop_images, default: true
@@ -27,10 +30,12 @@ class UserSettings
     setting :delete_modal, default: true
     setting :reblog_modal, default: false
     setting :unfollow_modal, default: true
+    setting :favourite_modal, default: false
     setting :reduce_motion, default: false
     setting :expand_content_warnings, default: false
     setting :display_media, default: 'default', in: %w(default show_all hide_all)
     setting :auto_play, default: false
+    setting :use_system_emoji_font, default: false
   end
 
   namespace :notification_emails do
@@ -42,6 +47,8 @@ class UserSettings
     setting :report, default: true
     setting :pending_account, default: true
     setting :trends, default: true
+    setting :link_trends, default: false
+    setting :status_trends, default: false
     setting :appeal, default: true
   end