mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 00:36:21 +00:00
21 lines
592 B
Ruby
21 lines
592 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ActivityPub
|
||
|
class RemoteFlag < ApplicationRecord
|
||
|
belongs_to :actor
|
||
|
belongs_to :site
|
||
|
|
||
|
# Genera la actividad a enviar
|
||
|
def content
|
||
|
{
|
||
|
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||
|
'id' => Rails.application.routes.url_helpers.v1_activity_pub_remote_flag_url(self, host: site.social_inbox_hostname),
|
||
|
'type' => 'Flag',
|
||
|
'actor' => ENV.fetch('PANEL_ACTOR_ID') { "https://#{ENV['SUTTY']}/about.jsonld" },
|
||
|
'content' => message.to_s,
|
||
|
'object' => [ actor.uri ]
|
||
|
}
|
||
|
end
|
||
|
end
|
||
|
end
|