ReplyPreview class
A bounded preview of a quoted message, as returned by
ConvoKit.getReplyPreviews
(GET /api/v1/conversations/:id/reply-previews?ids=).
A reply carries only Message.replyToMessageId; the quoted row itself is
resolved out of band, one batched request per rendered page rather than
one per row. Previews are conversation-scoped: an id in another room is
never returned. Ids that do not exist, were deleted, or belong to another
room are simply absent from the result — that is the only deletion signal
and it is never an error. Render an absent id as "original message
unavailable" while keeping the reference and the jump affordance.
text is the first 500 characters of the quoted text (null when the message has none) and textTruncated says whether more followed. mediaCount is the number of attachments, so a preview can show an attachment hint without fetching them.
Constructors
- ReplyPreview({required String id, required String conversationId, required String senderId, String? text, bool textTruncated = false, required DateTime createdAt, int revision = 0, int mediaCount = 0})
-
textTruncateddefaults to false andrevisionandmediaCountto 0, so a locally derived preview (a parent already in the loaded window) needs only the fields it has.const -
ReplyPreview.fromJson(Map<
String, dynamic> json) -
Decodes one preview row.
id,conversationId,appUserIdandcreatedAtare required; a missingtextTruncatedis false, a missingrevisionis 0 and a missingmediaCountis 0. A present but malformed value fails like every other model field, and a negativerevisionormediaCountis a FormatException.factory
Properties
- conversationId → String
-
The room the quoted message belongs to; always the conversation the
previews were requested for.
final
- createdAt → DateTime
-
The quoted message's server creation time.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
The quoted message's id, matching the
Message.replyToMessageIdthat asked for it.final - mediaCount → int
-
How many attachments the quoted message has; 0 for a text-only message.
The attachments themselves are not carried by a preview.
final
- revision → int
-
The quoted message's current
Message.revision, so a preview resolved after an edit can be told apart from a stale cached one.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderId → String
-
The quoted message's author: the same value
Message.senderIdcarries. Decoded from the wire keyappUserId, exactly asMessage.senderIdis. Named for the wire key so the model is identical on every ConvoKit SDK.final - text → String?
-
The first 500 characters of the quoted text, or null when the message
has no text (an attachment-only message). See textTruncated.
final
- textTruncated → bool
-
Whether the quoted message's text was longer than the 500 characters
carried in text.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Value equality over every field, so a store can tell a refreshed preview
from an unchanged one without comparing instances.
override