about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-03-08 06:01:17 +0000
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:21 -0500
commit467170f4a095c5c794ae4d8f46b5d57205590013 (patch)
tree65e84fd8b36303095aba331726f7b97902bfb8a5 /app/models
parentb5cb68581b5cc0a1f9f421763e37028775ca448f (diff)
more local-only options
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb8
-rw-r--r--app/models/user.rb6
2 files changed, 7 insertions, 7 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index cbb89bd16..4dd889485 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -508,11 +508,7 @@ class Status < ApplicationRecord
 
   def marked_local_only?
     # match both with and without U+FE0F (the emoji variation selector)
-    /#{local_only_emoji}\ufe0f?\z/.match?(content)
-  end
-
-  def local_only_emoji
-    '👁'
+    /#!\z/.match?(content)
   end
 
   def marked_no_replies?
@@ -560,7 +556,7 @@ class Status < ApplicationRecord
 
   def set_locality
     if account.domain.nil? && !attribute_changed?(:local_only)
-      self.local_only = marked_local_only?
+      self.local_only = marked_local_only? || account.user.setting_always_local
     end
   end
 
diff --git a/app/models/user.rb b/app/models/user.rb
index b1da03d02..ebf3fa422 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -102,7 +102,7 @@ class User < ApplicationRecord
 
   has_many :session_activations, dependent: :destroy
 
-  delegate :auto_play_gif, :default_local, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
+  delegate :auto_play_gif, :default_local, :always_local, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal,
            :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, :display_media, :hide_network, :hide_followers_count,
            :expand_spoilers, :default_language, :aggregate_reblogs, :show_application, :default_content_type, to: :settings, prefix: :setting, allow_nil: false
 
@@ -192,6 +192,10 @@ class User < ApplicationRecord
     settings.default_local || false
   end
 
+  def setting_always_local
+    settings.always_local || false
+  end
+
   def allows_digest_emails?
     settings.notification_emails['digest']
   end