- A fetched ObjectRecord no longer wears the signature, key, signed headers and @context of the activity that caused the fetch, and its ReceivedAt is the fetch's own time. Its activity fields now name the trigger. Provenance answers signature null and fetchedBy "instance-actor". Migration _008 clears the old fetched records. - ObjectRecords store their ObjectFeatures extensions and context namespaces (migration _009 fills older records in batches), so statistics can count them. Provenance reads the stored lists. - ForeignAvatar.Features records what an actor document uses (ActorFeatures): featured, shared inbox, FEP-521a, FEP-8b32, identity proofs, Misskey fields, indexable, undiscoverable, locked, key size, and more. - RemoteEdits.Apply and RemoteDeletes.Remove are shared by the Update, Delete and Announce handlers. A community-wrapped Update is now an edit only when newer, refreshes polls and media otherwise, revises the ObjectRecord and re-resolves quotes. A community-wrapped Delete now tombstones the object, removes its ObjectRecord, reblogs and timeline rows, and lowers the reply count. Any deleted quoting post lowers the quoted post's quote count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELjqpznMFMNrJoJUj6K5p2
53 lines
1.9 KiB
C#
53 lines
1.9 KiB
C#
using MongoDB.Entities;
|
|
|
|
namespace PrivaPub.Models.Federation
|
|
{
|
|
public class ObjectRecord : Entity
|
|
{
|
|
public string ObjectURI { get; set; }
|
|
public string PostId { get; set; }
|
|
public string ObjectType { get; set; }
|
|
public string Host { get; set; }
|
|
|
|
public string Raw { get; set; }//the object exactly as it reached us, unless it was larger than MaxRawBytes
|
|
public string RawHash { get; set; }//sha-256 of the raw bytes, hex
|
|
public int RawBytes { get; set; }
|
|
public bool RawTruncated { get; set; }
|
|
public string ActivityContext { get; set; }//the delivering activity's @context, which an embedded object does not repeat
|
|
|
|
public ObjectPath Path { get; set; }
|
|
public bool Refetched { get; set; }//delivered, but read again from its origin because it came embedded from another one
|
|
public string ActivityId { get; set; }//the activity that brought it, or that caused the fetch
|
|
public string ActivityType { get; set; }
|
|
public string ActivityActorURI { get; set; }
|
|
public string Inbox { get; set; }//"shared" or "personal" when delivered
|
|
public string SignatureScheme { get; set; }
|
|
public string KeyId { get; set; }
|
|
public string Algorithm { get; set; }
|
|
public List<string> SignedHeaders { get; set; } = new();
|
|
|
|
public DateTime ReceivedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime? Published { get; set; }
|
|
public DateTime? Updated { get; set; }
|
|
public List<ObjectRevision> Revisions { get; set; } = new();
|
|
public List<string> Extensions { get; set; }//ObjectFeatures, stored for statistics; null on records older than v1.16
|
|
public List<string> ContextNamespaces { get; set; }
|
|
}
|
|
|
|
public class ObjectRevision
|
|
{
|
|
public string Raw { get; set; }
|
|
public string RawHash { get; set; }
|
|
public bool RawTruncated { get; set; }
|
|
public string ActivityId { get; set; }
|
|
public DateTime? Updated { get; set; }
|
|
public DateTime ReceivedAt { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
public enum ObjectPath
|
|
{
|
|
Delivered,
|
|
Fetched
|
|
}
|
|
}
|