about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-29 17:40:44 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-29 17:40:44 -0500
commit9d55cfc6addd0c6f6d3974fab3d66f09972d9fc5 (patch)
treec05497152316c08dc334ed1d958cc0f40e2f2ec0
parent6fa955e8a1230ffdba48edec0b22129cb80e76e9 (diff)
fix delayed roars mentions bug, increase delay to 1 minute, include local only prop
-rw-r--r--app/services/post_status_service.rb7
-rw-r--r--app/workers/post_status_worker.rb7
-rw-r--r--config/locales/simple_form.en.yml2
3 files changed, 8 insertions, 8 deletions
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index 144cc19c9..a61a4f756 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -59,14 +59,15 @@ class PostStatusService < BaseService
     else
       return unless process_status!
       if @options[:delayed] || @account&.user&.delayed_roars?
-        delay_until = Time.now.utc + 30.seconds
+        delay_until = Time.now.utc + 1.minute
         opts = {
           visibility: @visibility,
+          local_only: @local_only,
           federate: @options[:federate],
           distribute: @options[:distribute],
           nocrawl: @options[:nocrawl],
           nomentions: @options[:nomentions],
-          delete_after: @delete_after.nil? ? nil : @delete_after + 30.seconds,
+          delete_after: @delete_after.nil? ? nil : @delete_after + 1.minute,
         }.compact
 
         PostStatusWorker.perform_at(delay_until, @status.id, opts)
@@ -165,7 +166,7 @@ class PostStatusService < BaseService
     return false if @status.destroyed?
 
     process_hashtags_service.call(@status, @tags, @preloaded_tags)
-    process_mentions_service.call(@status) unless @delayed || @options[:nomentions]
+    process_mentions_service.call(@status) unless @options[:delayed] || @options[:nomentions]
 
     return true
   end
diff --git a/app/workers/post_status_worker.rb b/app/workers/post_status_worker.rb
index e9b73b8bc..630d83fae 100644
--- a/app/workers/post_status_worker.rb
+++ b/app/workers/post_status_worker.rb
@@ -9,10 +9,9 @@ class PostStatusWorker
     status = Status.find(status_id)
     return false if status.destroyed?
 
-    if options[:visibility]
-      status.visibility = options[:visibility]
-      status.save!
-    end
+    status.visibility = options[:visibility] if options[:visibility]
+    status.local_only = options[:local_only] if options[:local_only]
+    status.save!
 
     process_mentions_service.call(status) unless options[:nomentions]
 
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index f9bda46b3..d56691bbe 100644
--- a/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
@@ -118,7 +118,7 @@ en:
         setting_default_language: Posting language
         setting_default_privacy: Post privacy
         setting_roar_lifespan: Auto-delete new roars after
-        setting_delayed_roars: Delayed publishing of roars for proofreading (30 secs)
+        setting_delayed_roars: Delayed publishing of roars for proofreading (1 min)
         setting_default_local: Default to Monsterpit-only roars (in Glitch flavour)
         setting_always_local: Don't send your roars outside Monsterpit
         setting_rawr_federated: Show raw world timeline (may contain offensive content!)