Class: Federails::Activity

Inherits:
ApplicationRecord show all
Includes:
HasUuid
Defined in:
app/models/federails/activity.rb

Overview

Activities can be compared to a log of what happened in the Fediverse.

Activities from local actors ends in the actors outboxes. Activities form distant actors comes from the actor’s inbox. We try to only keep activities from local actors, and external activities targetting local actors.

See also:

- https://www.w3.org/TR/activitypub/#outbox
- https://www.w3.org/TR/activitypub/#inbox

Instance Method Summary collapse

Methods included from HasUuid

#to_param, #uuid

Instance Method Details

#recipientsArray<Federails::Actor>

Determines the list of actors targeted by the activity

Returns:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/models/federails/activity.rb', line 30

def recipients
  return [] unless actor.local?

  case action
  when 'Follow'
    [entity]
  when 'Undo'
    [entity.entity]
  when 'Accept'
    [entity.actor]
  else
    default_recipient_list
  end
end