class ActivityPub::Actor

Included Modules

Extended Modules

Direct Known Subclasses

Defined in:

models/activity_pub/actor.cr
models/activity_pub/actor/application.cr
models/activity_pub/actor/group.cr
models/activity_pub/actor/organization.cr
models/activity_pub/actor/person.cr
models/activity_pub/actor/service.cr
models/activity_pub/collection/ordered_collection.cr
rules/content_rules.cr

Constant Summary

ATTACHMENT_LIMIT = 4

Class Method Summary

Instance Method Summary

Class methods inherited from module ActivityPub

from_json_ld(json, **options) from_json_ld, from_json_ld?(json, **options) from_json_ld?

Instance methods inherited from module Ktistec::Model::Linked

cached? cached?, local? local?, origin origin, to_s(io : IO) to_s, uid uid

Instance methods inherited from module Ktistec::Model::Polymorphic

as_a(as _as : T.class) : T forall T as_a, type : String type, type=(type : String) type=

Instance methods inherited from module Ktistec::Model::Deletable

delete delete, deleted? deleted?, deleted_at : Time | Nil deleted_at, deleted_at=(deleted_at : Time | Nil) deleted_at=

Instance methods inherited from module Ktistec::Model::Blockable

block block, blocked? blocked?, blocked_at : Time | Nil blocked_at, blocked_at=(blocked_at : Time | Nil) blocked_at=, unblock unblock

Instance methods inherited from module Ktistec::Model::Common

created_at : Time created_at, created_at=(created_at : Time) created_at=, updated_at : Time updated_at, updated_at=(updated_at : Time) updated_at=

Instance methods inherited from module Ktistec::Model::InstanceMethods

==(other) ==, _run_validations _run_validations, _save_model(skip_validation = false) _save_model, _serialize_graph(nodes, association = nil, index = nil, skip_associated = false) _serialize_graph, _update_property(property, value) _update_property, assign(options : Hash(String, Any)) forall Any
assign(**options)
assign
, changed!(property : Symbol) changed!, changed?(property : Symbol | Nil = nil) changed?, clear!(property : Symbol | Nil = nil) clear!, destroy destroy, destroyed? destroyed?, errors errors, inspect(io : IO) inspect, new_record? new_record?, save(skip_validation = false, skip_associated = false) save, serialize_graph(skip_associated = false) serialize_graph, table_name table_name, to_h to_h, to_json(json : JSON::Builder) to_json, to_s(io : IO) to_s, valid?(skip_associated = false) valid?, validate(skip_associated = false) validate

Constructor methods inherited from module Ktistec::Model::InstanceMethods

new(options : Hash(String, Any)) forall Any
new(**options)
new

Instance methods inherited from module Ktistec::Model({Common, Blockable, Deletable, Polymorphic, Serialized, Linked})

id : Int64 | Nil id, id=(id : Int64 | Nil) id=

Instance methods inherited from class Ktistec::KeyPair

iri iri, private_key private_key, public_key public_key

Class Method Detail

def self.attachments_from_ldjson(entry) #

[View source]
def self.dereference?(key_pair, iri, *, ignore_cached = false, **options) : self | Nil #

def self.find(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false) #

def self.find?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false) #

def self.from_json_ld(json, **options) #

[View source]
def self.from_json_ld?(json, **options) #

[View source]
def self.map(json, *, include_key = false, **options) #

[View source]
def self.map_icon?(json) #

[View source]
def self.match?(account) #

[View source]

Instance Method Detail

def _association_filter_terms #

[View source]
def _association_objects #

[View source]
def _has_many_setter_for_filter_terms(filter_terms : Enumerable(FilterTerm), update_associations = true) : Enumerable(FilterTerm) #

[View source]
def _has_many_setter_for_objects(objects : Enumerable(ActivityPub::Object), update_associations = true) : Enumerable(ActivityPub::Object) #

[View source]
def account_uri #

[View source]
def all_followers(page = 1, size = 10, public = false) #

[View source]
def all_following(page = 1, size = 10, public = true) #

[View source]
def all_posts(page = 1, size = 10) #

Returns an actor's own posts

Meant to be called on local (not cached) actors.

Includes private posts and replies!


[View source]
def approve(object) #

[View source]
def attachments : Array(Attachment) | Nil #

[View source]
def attachments=(attachments : Array(Attachment) | Nil) #

[View source]
def before_validate #

[View source]
def display_link #

[View source]
def display_name #

[View source]
def drafts(page = 1, size = 10) #

[View source]
def filter_terms(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(FilterTerm) #

[View source]
def filter_terms=(filter_terms : Enumerable(FilterTerm)) : Enumerable(FilterTerm) #

[View source]
def find_activity_for(object, inclusion = nil, exclusion = nil) #

[View source]
def find_announce_for(object : Object) #

[View source]
def find_like_for(object : Object) #

[View source]
def follow(other : Actor, **options) #

[View source]
def followers : String | Nil #

[View source]
def followers=(followers : String | Nil) #

[View source]
def following : String | Nil #

[View source]
def following=(following : String | Nil) #

[View source]
def follows?(other : Actor, **options) #

[View source]
def from_json_ld(json, *, include_key = false) #

[View source]
def icon : String | Nil #

[View source]
def icon=(icon : String | Nil) #

[View source]
def image : String | Nil #

[View source]
def image=(image : String | Nil) #

[View source]
def in_inbox(page = 1, size = 10, public = true) #

[View source]
def in_inbox?(object : Object, inclusion = nil, exclusion = nil) #

[View source]
def in_outbox(page = 1, size = 10, public = true) #

[View source]
def in_outbox?(object : Object, inclusion = nil, exclusion = nil) #

[View source]
def inbox : String | Nil #

[View source]
def inbox=(inbox : String | Nil) #

[View source]
def iri : String #

def iri=(iri : String) #

def known_posts(page = 1, size = 10) #

Returns the actor's known posts.

Meant to be called on both local and cached actors.

Does not include private (not visible) posts.


[View source]
def make_delete_activity #

[View source]
def name : String | Nil #

[View source]
def name=(name : String | Nil) #

[View source]
def notifications(since : Time) #

Returns the count of notification activities for the actor since the given date.

See #notifications(page, size) for further details.


[View source]
def notifications(page = 1, size = 10) #

Returns notification activities for the actor.

Meant to be called on local (not cached) actors.

Note: filters out activities that have associated objects that have been deleted. does not filter out activities that are not associated with an object since some activities, like follows, are associated with actors. doesn't worry about actors that have been deleted since follows, the activities we care about in this case, are associated with the actor on which this method is called.


[View source]
def objects(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(ActivityPub::Object) #

[View source]
def objects=(objects : Enumerable(ActivityPub::Object)) : Enumerable(ActivityPub::Object) #

[View source]
def outbox : String | Nil #

[View source]
def outbox=(outbox : String | Nil) #

[View source]
def pem_private_key : String | Nil #

[View source]
def pem_private_key=(pem_private_key : String | Nil) #

[View source]
def pem_public_key : String | Nil #

[View source]
def pem_public_key=(pem_public_key : String | Nil) #

[View source]
def private_key #

[View source]
def public_key #

[View source]
def public_posts(page = 1, size = 10) #

Returns the actor's public posts.

Meant to be called on local (not cached) actors.

Does not include private (not visible) posts and replies.


[View source]
def summary : String | Nil #

[View source]
def summary=(summary : String | Nil) #

[View source]
def terms(page = 1, size = 10) #

Returns the content filter terms for the actor.


[View source]
def timeline(since : Time, exclude_replies = false, inclusion = nil) #

Returns the count of objects in the actor's timeline since the given date.

See #timeline(inclusion, page, size) for further details.


[View source]
def timeline(exclude_replies = false, inclusion = nil, page = 1, size = 10) #

Returns objects in the actor's timeline.

Meant to be called on local (not cached) actors.

Includes private (not visible) posts and replies.

May be filtered to exclude replies (via exclude_replies).

May be filtered to include only objects with associated activities of the specified type (via inclusion).


[View source]
def to_json_ld(recursive = true) #

[View source]
def unapprove(object) #

[View source]
def urls : Array(String) | Nil #

[View source]
def urls=(urls : Array(String) | Nil) #

[View source]
def username : String | Nil #

[View source]
def username=(username : String | Nil) #

[View source]