about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/lib/bangtags.rb2
-rw-r--r--app/models/status.rb12
-rw-r--r--app/services/post_status_service.rb2
3 files changed, 15 insertions, 1 deletions
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index c85f4ee34..53c63bf78 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -558,7 +558,6 @@ class Bangtags
             chunk = nil
             del_tags(@parent_status, 'self.draft', 'draft')
             Bangtags.new(@parent_status).process
-            @parent_status.save
             PostStatusWorker.perform_async(@parent_status.id, hidden: false, process_mentions: true)
           end
 
@@ -708,6 +707,7 @@ class Bangtags
         when 'draft'
           chunk = nil
           @status.hidden = true
+          @status.keep_hidden!
           @vore_stack.push('_draft')
           @component_stack.push(:var)
           add_tags(status, 'self.draft')
diff --git a/app/models/status.rb b/app/models/status.rb
index a1dc37fe8..36efaf765 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -328,6 +328,18 @@ class Status < ApplicationRecord
     @no_clobber_expirations || false
   end
 
+  def keep_hidden!
+    @keep_hidden = true
+  end
+
+  def keep_unhidden!
+    @keep_hidden = false
+  end
+
+  def keep_hidden?
+    @keep_hidden || false
+  end
+
   def mark_for_mass_destruction!
     @marked_for_mass_destruction = true
   end
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index fde56238a..9e405fe1c 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -233,6 +233,8 @@ class PostStatusService < BaseService
 
     return false if @status.destroyed?
 
+    @hidden = @status.keep_hidden? if @options[:hidden].blank?
+
     set_expirations
     process_hashtags_service.call(@status, @tags, @preloaded_tags)
     process_mentions