about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/statuses_controller.rb2
-rw-r--r--app/lib/bangtags.rb4
2 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index c8c8e52e4..8618f6e34 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -209,9 +209,11 @@ class StatusesController < ApplicationController
     when '1'
       @status.sharekey = SecureRandom.urlsafe_base64(32)
       @status.save
+      Rails.cache.delete("statuses/#{@status.id}")
     when '0'
       @status.sharekey = nil
       @status.save
+      Rails.cache.delete("statuses/#{@status.id}")
     end
   end
 
diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 6f2f03d30..c1bb62c3d 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -251,6 +251,7 @@ class Bangtags
                   if roar.sharekey.present?
                     roar.sharekey = nil
                     roar.save
+                    Rails.cache.delete("statuses/#{roar.id}")
                   end
                 end
               end
@@ -262,6 +263,7 @@ class Bangtags
                   sharekey = SecureRandom.urlsafe_base64(32)
                   earliest_roar.sharekey = sharekey
                   earliest_roar.save
+                  Rails.cache.delete("statuses/#{earliest_roar.id}")
                 else
                   sharekey = earliest_roar.sharekey
                 end
@@ -269,11 +271,13 @@ class Bangtags
                   if roar.sharekey != sharekey
                     roar.sharekey = sharekey
                     roar.save
+                    Rails.cache.delete("statuses/#{roar.id}")
                   end
                 end
               else
                 status.sharekey = SecureRandom.urlsafe_base64(32)
                 status.save
+                Rails.cache.delete("statuses/#{status.id}")
               end
             end
           end