about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/status.rb8
-rw-r--r--app/services/post_status_service.rb3
2 files changed, 8 insertions, 3 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 9ae753447..94b2a1aa9 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -141,6 +141,8 @@ class Status < ApplicationRecord
 
   around_create Mastodon::Snowflake::Callbacks
 
+  before_create :set_locality
+
   before_validation :prepare_contents, if: :local?
   before_validation :set_reblog
   before_validation :set_visibility
@@ -302,6 +304,12 @@ class Status < ApplicationRecord
     self.sensitive = sensitive || spoiler_text.present?
   end
 
+  def set_locality
+    if account.domain.nil?
+      self.local_only = marked_local_only?
+    end
+  end
+
   def set_conversation
     self.reply = !(in_reply_to_id.nil? && thread.nil?) unless reply
 
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index c7b5e8ffb..ff6cfbe8f 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -40,9 +40,6 @@ class PostStatusService < BaseService
     LinkCrawlWorker.perform_async(status.id) unless status.spoiler_text?
     DistributionWorker.perform_async(status.id)
 
-    status.local_only = status.marked_local_only?
-    status.save!
-
     unless status.local_only
       Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id)
       ActivityPub::DistributionWorker.perform_async(status.id)