class

Rules::View::TimelineCreate

Inherits Rules::View::NotifiesTimeline < Rules::View < Reference < Object

The create-kept half of the timeline view.

There is one row per object in the actor's timeline, fixed at its first contribution and never repositioned. An object is create-kept when a create (or update) in the actor's mailbox delivered it and at least one of the following holds:

  • the post is the actor's own (replies included),
  • the post mentions the actor (replies and mentions of others don't disqualify it), or
  • the post is not a reply and has no mentions at all.

An object that is both create-kept and announced yields only the create row, never also an announce (see TimelineAnnounce).

Constants

MENTION = "Tag::Mention"
QUALIFIES = " (o.in_reply_to_iri IS NULL\n AND NOT EXISTS (\n SELECT 1\n FROM tags t\n WHERE t.type = '#{MENTION}'\n AND t.subject_iri = o.iri\n ))\n OR o.attributed_to_iri = m.from_iri\n OR EXISTS (\n SELECT 1\n FROM tags t\n WHERE t.type = '#{MENTION}'\n AND t.subject_iri = o.iri\n AND t.href = m.from_iri\n )"

The create-kept disjunction. TimelineAnnounce embeds it, negated, so that the two timeline views are mutually exclusive by construction. At every embed site, m is the qualifying create/update's mailbox row, a that activity, and o the object (the announce view's subquery aliases shadow its outer announce aliases to guarantee this).

Constructors

instance
Source

Instance methods

membership(key : Key | Nil = nil) : Tuple(String, Array(DB::Any))

The membership query, plus its bind arguments.

The query selects rows of (from_iri, to_iri, position). A key of nil returns the full set (the batch reconcile); otherwise it returns the form scoped to a single member.

Source
project(object_iri : String) : Array(Key)

Maps a changed base fact to the collection key(s).

Source
type

The relationship subtype this view materializes.

Source