class

ActivityPub::Object

Inherits ActivityPub < Ktistec::Model::Blockable < Ktistec::Model::Deletable < Ktistec::Model::Polymorphic < Ktistec::Model::Linked < Ktistec::Model::Common < Ktistec::Model < Reference < Object

Constants

ALIASES = ["ActivityPub::Object::Audio", "ActivityPub::Object::Event", "ActivityPub::Object::Image", "ActivityPub::Object::Page", "ActivityPub::Object::Place", "ActivityPub::Object::Video"]
Log = ::Log.for(self)
PROJECTION_METADATA = { id: Int64, iri: String, attributed_to_iri: ::Union(String, ::Nil), in_reply_to_iri: ::Union(String, ::Nil), thread: ::Union(String, ::Nil), published: ::Union(Time, ::Nil), deleted: Bool, blocked: Bool, hashtags: ::Union(String, ::Nil), mentions: ::Union(String, ::Nil), depth: Int32, }
PROJECTION_MINIMAL = { id: Int64, iri: String, in_reply_to_iri: ::Union(String, ::Nil), thread: ::Union(String, ::Nil), depth: Int32, }

Predefined thread query projection definitions.

Constructors

dereference(key_pair, iri, *, ignore_cached = false, include_deleted = false, deadline : Time::Instant | Nil, **options) : self
Source

Class methods

all_subtypes

Returns type and all concrete (non-abstract) subtypes, including any aliases defined on the type.

Source
count_by_attributed_to(iri : String)

Returns the count of objects attributed to the actor.

Intended as an approximate posts count, so it deliberately skips the visibility/deletion filtering that the exact post queries apply.

Source
dereference?(key_pair, iri, *, ignore_cached = false, include_deleted = false, deadline : Time::Instant | Nil = nil, **options) : self | Nil
Source
federated_posts(*, max_id = nil, min_id = nil, limit = 10)

Returns federated posts with cursor-based pagination.

Includes local posts. Does not include private (not visible) posts.

Source
federated_posts_count

Returns the count of federated posts.

Includes local posts. Does not include private (not visible) posts.

Source
find(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Source
find?(_iri iri : String | Nil, include_deleted : Bool = false, include_undone : Bool = false)
Source
from_json_ld(json, **options)
Source
from_json_ld?(json, **options)
Source
latest_public_post

Returns an identifier associated with the latest public post.

Skips many joins and filters in the interest of speed.

It is intended for use in expiring cached results from the two methods above. If the identifier changes, the cached results are probably stale.

NB: The "identifier" is not necessarily the id of the latest post!

Source
map(json, **options)
Source
public_posts(*, max_id = nil, min_id = nil, limit = 10)

Returns the site's public posts with cursor-based pagination.

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

Source
public_posts_count

Returns the count of the site's public posts.

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

Source

Instance methods

_append_to_emojis(model_ : Tag::Emoji) : Nil
Source
_append_to_hashtags(model_ : Tag::Hashtag) : Nil
Source
_append_to_mentions(model_ : Tag::Mention) : Nil
Source
_append_to_translations(model_ : Translation) : Nil
Source
_association_attributed_to
Source
_association_emojis
Source
_association_hashtags
Source
_association_in_reply_to
Source
_association_mentions
Source
_association_quote
Source
_association_quote_authorization
Source
_association_translations
Source
_belongs_to_setter_for_attributed_to(attributed_to_ : ActivityPub::Actor, update_associations = true) : ActivityPub::Actor
Source
_belongs_to_setter_for_in_reply_to(in_reply_to_ : ActivityPub::Object, update_associations = true) : ActivityPub::Object
Source
_belongs_to_setter_for_quote(quote_ : ActivityPub::Object, update_associations = true) : ActivityPub::Object
Source
_belongs_to_setter_for_quote_authorization(quote_authorization_ : QuoteAuthorization, update_associations = true) : QuoteAuthorization
Source
_has_many_setter_for_emojis(emojis_ : Enumerable(Tag::Emoji), update_associations = true) : Enumerable(Tag::Emoji)
Source
_has_many_setter_for_hashtags(hashtags_ : Enumerable(Tag::Hashtag), update_associations = true) : Enumerable(Tag::Hashtag)
Source
_has_many_setter_for_mentions(mentions_ : Enumerable(Tag::Mention), update_associations = true) : Enumerable(Tag::Mention)
Source
_has_many_setter_for_translations(translations_ : Enumerable(Translation), update_associations = true) : Enumerable(Translation)
Source
activities(inclusion = nil, exclusion = nil)
Source
addressed?(actor : ActivityPub::Actor) : Bool

Returns true if the object is addressed to the given actor.

Source
after_create
Source
after_delete
Source
after_destroy
Source
after_save
Source

Analyzes thread structure and participation patterns.

Returns comprehensive analysis including statistics, key participants, notable branches, and timeline histogram.

Source
ancestors(*, include_deleted = false, include_blocked = false)

Returns the ancestors from self up to the root.

Deleted/blocked ancestors are omitted from the result. Pass include_deleted: true or include_blocked: true to include those rows. special objects are always excluded.

Source
announces_count
Source
announces_count=(announces_count : Int64)
Source
approved_by?(approved_by)
Source
attachments
Source
attachments=(attachments : Array(Attachment) | Nil)
Source
attributed_to(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Actor
Source
attributed_to(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
attributed_to=(attributed_to_ : ActivityPub::Actor) : ActivityPub::Actor
Source
attributed_to?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Actor | Nil
Source
attributed_to?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
attributed_to_iri
Source
attributed_to_iri=(attributed_to_iri : String | Nil)
Source
audience
Source
audience=(audience : Array(String) | Nil)
Source
before_destroy
Source
before_save
Source
before_validate
Source
canonical_path
Source
canonical_path=(canonical_path : Nil | String)
Source
cc=(cc : Array(String) | Nil)
Source
content
Source
content=(content : String | Nil)
Source
delayed?
Source
depth
Source
depth=(depth : Int32)
Source
descendants(*, include_deleted = false, include_blocked = false)

Returns the subtree rooted at self.

Deleted/blocked descendants are omitted from the result. Pass include_deleted: true or include_blocked: true to include those rows. special objects are always excluded.

Source
dislikes_count
Source
dislikes_count=(dislikes_count : Int64)
Source
display_attachments

Returns the media to present for this object.

Source
display_date(timezone = nil)
Source
draft?
Source
emojis(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(Tag::Emoji)
Source
emojis=(emojis_ : Enumerable(Tag::Emoji)) : Enumerable(Tag::Emoji)
Source
external?
Source
from_json_ld(json)
Source
hashtags(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(Tag::Hashtag)
Source
hashtags=(hashtags_ : Enumerable(Tag::Hashtag)) : Enumerable(Tag::Hashtag)
Source
in_reply_to(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Object
Source
in_reply_to(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
in_reply_to=(in_reply_to_ : ActivityPub::Object) : ActivityPub::Object
Source
in_reply_to?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Object | Nil
Source
in_reply_to?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
in_reply_to_iri
Source
in_reply_to_iri=(in_reply_to_iri : String | Nil)
Source
iri
iri=(iri : String)
language
Source
language=(language : String | Nil)
Source
likes_count
Source
likes_count=(likes_count : Int64)
Source
make_delete_activity
Source
media_type
Source
media_type=(media_type : String | Nil)
Source
mentions(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(Tag::Mention)
Source
mentions=(mentions_ : Enumerable(Tag::Mention)) : Enumerable(Tag::Mention)
Source
name
Source
name=(name : String | Nil)
Source
optional_properties?

Returns true if any of the object's optional properties are set.

Source
preview

Returns the text to use for the preview of the object with fallback.

The method checks for text in the following order:

  1. Summary from translation
  2. Summary from the object
  3. Content from translation
  4. Content from the object

Returns the first non-blank value found, or nil.

Source
published
Source
published=(published : Time | Nil)
Source
quote(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Object
Source
quote(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
quote?(include_deleted : Bool = false, include_undone : Bool = false) : ActivityPub::Object | Nil
Source
quote?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
quote_approved?(quoted_object : ActivityPub::Object) : Bool

Returns true if this object's quote of quoted_object is approved by the latter's author.

Source
quote_authorization(include_deleted : Bool = false, include_undone : Bool = false) : QuoteAuthorization
Source
quote_authorization(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil, **options)
quote_authorization=(quote_authorization_ : QuoteAuthorization) : QuoteAuthorization
Source
quote_authorization?(include_deleted : Bool = false, include_undone : Bool = false) : QuoteAuthorization | Nil
Source
quote_authorization?(key_pair, *, dereference = false, ignore_cached = false, ignore_changed = false, include_deleted = false, include_undone = false, deadline : Time::Instant | Nil = nil, **options)
quote_authorization_iri
Source
quote_authorization_iri=(quote_authorization_iri : String | Nil)
Source
quote_iri
Source
quote_iri=(quote_iri : String | Nil)
Source
quote_request?
Source
replies
Source
replies(*, for_actor)

Returns all replies to this object.

Intended for presenting an object's replies to an authorized user (one who may see all objects).

The for_actor parameter must be specified to disambiguate this method from the replies property getter, but is not currently used.

Source
replies(*, approved_by)

Returns all replies to this object which have been approved by approved_by.

Intended for presenting an object's replies to an unauthorized user (one who may not see all objects e.g. an anonymous user).

Source
replies=(replies : ActivityPub::Collection)
Source
replies?
Source
replies_count
Source
replies_count=(replies_count : Int64)
Source
replies_iri
Source
replies_iri=(replies_iri : String | Nil)
Source
reply?
Source
root?
Source
self_replies

Returns self-replies in threaded order.

Self-replies are replies to this object or its descendants that share the same author as this object. They are returned in thread ordered (parent before children).

The position string encodes the path through the reply tree, ensuring correct ordering even when posts are fetched out of order. The id distinguishes siblings when an author self-replies multiple times to the same parent.

Source
sensitive
Source
sensitive=(sensitive : Bool)
Source
short_date(timezone = nil)
Source
source
Source
source=(source : Source | Nil)
Source
special
Source
special=(special : String | Nil)
Source
summary
Source
summary=(summary : String | Nil)
Source
supported_editors

Returns the editor types supported for this object.

Source
tags
Source
thread
Source
thread(*, for_actor)

Returns all objects in the thread to which this object belongs.

Intended for presenting a thread to an authorized user (one who may see all objects in a thread).

Filters out special objects (e.g. votes).

Does not filter out deleted or blocked objects. Leaves decisions about presentation of these objects and their replies to the caller.

The for_actor parameter must be specified to disambiguate this method from the thread property getter, but is not currently used.

Source
thread(*, approved_by)

Returns all objects in the thread to which this object belongs which have been approved by approved_by.

Filters out special objects (e.g. votes).

Does not filter out deleted or blocked objects. Leaves decisions about presentation of these objects and their replies to the caller.

Intended for presenting a thread to an unauthorized user (one who may not see all objects in a thread e.g. an anonymous user).

Source
thread!

Updates the thread and saves the object.

On older databases, threads are lazily migrated. This is a convenience method for triggering the update and save, and returning the value.

Source
thread=(thread : String | Nil)
Source
thread_query(*, projection : T) forall T

Returns projected fields for all objects in the thread.

The projection parameter accepts a NamedTuple that defines which fields to return. Predefined constants handle common use-cases:

  • PROJECTION_MINIMAL
  • PROJECTION_METADATA

Or specify a custom projection: projection: {id: Int64, iri: String, depth: Int32}

Returns Array(NamedTuple) with named fields.

Source
to=(to : Array(String) | Nil)
Source
to_json_ld(recursive = true)
Source
translations(include_deleted : Bool = false, include_undone : Bool = false) : Enumerable(Translation)
Source
translations=(translations_ : Enumerable(Translation)) : Enumerable(Translation)
Source
updated
Source
updated=(updated : Time | Nil)
Source
urls
Source
urls=(urls : Array(String) | Nil)
Source
validate_model
Source
visible
Source
visible=(visible : Bool)
Source
with_replies_count!(approved_by)
Source
with_replies_count!
Source
with_statistics!
Source

Nested types