diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/status.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index e81331e93..c12e72f10 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -298,6 +298,20 @@ class Status < ApplicationRecord update_status_stat!(key => [public_send(key) - 1, 0].max) end + def notify=(value) + Redis.current.set("status:#{id}:notify", value ? 1 : 0, ex: 1.hour) + @notify = value + end + + def notify + return @notify if defined?(@notify) + + value = Redis.current.get("status:#{id}:notify") + @notify = value.nil? ? true : value.to_i == 1 + end + + alias notify? notify + def less_private_than?(other_visibility) return false if other_visibility.blank? |