|
|
@ -141,6 +141,8 @@ class Status < ApplicationRecord |
|
|
|
|
|
|
|
|
|
|
|
around_create Mastodon::Snowflake::Callbacks |
|
|
|
around_create Mastodon::Snowflake::Callbacks |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before_create :set_locality |
|
|
|
|
|
|
|
|
|
|
|
before_validation :prepare_contents, if: :local? |
|
|
|
before_validation :prepare_contents, if: :local? |
|
|
|
before_validation :set_reblog |
|
|
|
before_validation :set_reblog |
|
|
|
before_validation :set_visibility |
|
|
|
before_validation :set_visibility |
|
|
@ -302,6 +304,12 @@ class Status < ApplicationRecord |
|
|
|
self.sensitive = sensitive || spoiler_text.present? |
|
|
|
self.sensitive = sensitive || spoiler_text.present? |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_locality |
|
|
|
|
|
|
|
if account.domain.nil? |
|
|
|
|
|
|
|
self.local_only = marked_local_only? |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def set_conversation |
|
|
|
def set_conversation |
|
|
|
self.reply = !(in_reply_to_id.nil? && thread.nil?) unless reply |
|
|
|
self.reply = !(in_reply_to_id.nil? && thread.nil?) unless reply |
|
|
|
|
|
|
|
|
|
|
|