EventVisibilityResolver class

Decides which cached events are visible, and why the others are not.

Visibility cannot be decided from a query result alone: the winner of a conflict domain and the NIP-09 deletion that covers an event can both sit outside it. Grouping only what a filter returned makes an old version look current whenever the filter excluded its successor, for example a read by event id. So the resolver runs one extra raw read to fetch that context, then classifies the candidates against it.

Constructors

EventVisibilityResolver(RawEventLoader _loadRawEvents)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

filterVisible(List<Nip01Event> candidates, {int? now}) Future<List<Nip01Event>>
Keeps the candidates that are currently visible, in the given order.
loadHiddenEvents({List<String>? ids, List<String>? pubKeys, List<int>? kinds, List<String>? coordinates, Map<String, List<String>>? tags, int? since, int? until, String? search, int? limit, Set<HiddenEventReason> reasons = kAllHiddenEventReasons, int? now}) Future<List<HiddenEvent>>
Implements CacheManager.loadHiddenEvents on top of a raw loader.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hiddenReasons(EventCacheStateRecord record, int now) Set<HiddenEventReason>
Why visible reads hide the event behind record, empty when they do not.