about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-11-23 23:10:05 -0600
committerFire Demon <firedemon@creature.cafe>2020-11-23 23:10:05 -0600
commit65a9abb315f18ac777f3d0e09b3f7399830ad243 (patch)
tree39712b50201749efad11dce09561d81f4bdcdb2f /app/models
parent7f5ba917563aa1c9a373d9dd3a6a29f73d81ee9a (diff)
Add user options to disable recipient verification, allow anonymous public access; rework private mode
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb3
-rw-r--r--app/models/status.rb5
-rw-r--r--app/models/user.rb2
3 files changed, 6 insertions, 4 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 90145ceb2..bf286d111 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -53,10 +53,11 @@
 #  show_replies                  :boolean          default(TRUE), not null
 #  show_unlisted                 :boolean          default(TRUE), not null
 #  private                       :boolean          default(FALSE), not null
-#  require_auth                  :boolean          default(FALSE), not null
 #  last_synced_at                :datetime
 #  sensitized_at                 :datetime
 #  suspension_origin             :integer
+#  no_verify_auth                :boolean          default(FALSE), not null
+#  allow_anonymous               :boolean          default(FALSE), not null
 #
 
 class Account < ApplicationRecord
diff --git a/app/models/status.rb b/app/models/status.rb
index 73eda2c4c..f20e7710d 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -254,7 +254,7 @@ class Status < ApplicationRecord
   end
 
   def distributable?
-    public_visibility? || unlisted_visibility?
+    !account.private? && (public_visibility? || unlisted_visibility?)
   end
 
   alias sign? distributable?
@@ -344,6 +344,7 @@ class Status < ApplicationRecord
 
   def visibility_for_domain(domain)
     return visibility.to_s if domain.blank?
+    return 'private' if account.private?
 
     v = domain_permissions.find_by(domain: [domain, '*'])&.visibility || visibility.to_s
 
@@ -659,7 +660,7 @@ class Status < ApplicationRecord
     if reply? && !thread.nil?
       self.in_reply_to_account_id = carried_over_reply_to_account_id
       self.conversation_id        = thread.conversation_id if conversation_id.nil?
-      self.visibility             = :limited if visibility.to_s == 'private' && in_reply_to_account_id != account_id
+      self.visibility             = :limited if in_reply_to_account_id != account_id && (visibility.to_s == 'private' || account.private?)
     end
   end
 
diff --git a/app/models/user.rb b/app/models/user.rb
index 8d91593ae..d3ac464d7 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -124,7 +124,7 @@ class User < ApplicationRecord
            :style_css_profile_errors, :style_css_webapp, :style_css_webapp_errors,
            :style_wide_media, :style_lowercase,
            :publish_in, :unpublish_in, :unpublish_delete, :boost_every, :boost_jitter,
-           :boost_random, :unpublish_on_delete, :rss_disabled, :home_reblogs,
+           :boost_random, :unpublish_on_delete, :home_reblogs,
            :filter_unknown, :max_history_public, :max_history_private, :web_push,
            to: :settings, prefix: :setting, allow_nil: false