@ -46,7 +46,8 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
visibility : visibility_scope ,
visibility : visibility_scope ,
conversation : find_or_create_conversation ,
conversation : find_or_create_conversation ,
thread : thread? ? find_status ( thread . first ) || find_activitypub_status ( thread . first , thread . second ) : nil ,
thread : thread? ? find_status ( thread . first ) || find_activitypub_status ( thread . first , thread . second ) : nil ,
media_attachment_ids : media_attachments . map ( & :id )
media_attachment_ids : media_attachments . map ( & :id ) ,
sensitive : sensitive?
)
)
save_mentions ( status )
save_mentions ( status )
@ -105,6 +106,11 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
private
private
def sensitive?
# OStatus-specific convention (not standard)
@xml . xpath ( './xmlns:category' , xmlns : OStatus :: TagManager :: XMLNS ) . any? { | category | category [ 'term' ] == 'nsfw' }
end
def find_or_create_conversation
def find_or_create_conversation
uri = @xml . at_xpath ( './ostatus:conversation' , ostatus : OStatus :: TagManager :: OS_XMLNS ) & . attribute ( 'ref' ) & . content
uri = @xml . at_xpath ( './ostatus:conversation' , ostatus : OStatus :: TagManager :: OS_XMLNS ) & . attribute ( 'ref' ) & . content
return if uri . nil?
return if uri . nil?