Fix quote is not set in noteserializer

This commit is contained in:
KMY 2023-09-19 18:22:18 +09:00
parent 77eb7c03d9
commit 818bcc0277
4 changed files with 33 additions and 3 deletions

View file

@ -2,6 +2,11 @@
module ActivityPub::CaseTransform
class << self
NO_CONVERT_VALUES = %w(
_misskey_content
_misskey_quote
).freeze
def camel_lower_cache
@camel_lower_cache ||= {}
end
@ -12,7 +17,9 @@ module ActivityPub::CaseTransform
when Hash then value.deep_transform_keys! { |key| camel_lower(key) }
when Symbol then camel_lower(value.to_s).to_sym
when String
camel_lower_cache[value] ||= if value.start_with?('_:')
camel_lower_cache[value] ||= if NO_CONVERT_VALUES.include?(value)
value
elsif value.start_with?('_:')
"_:#{value.delete_prefix('_:').underscore.camelize(:lower)}"
else
value.underscore.camelize(:lower)