Table of Contents

Class IncomingEnvelope

Namespace
Signal.Domain.Messaging
Assembly
Signal.Domain.dll

Aggregate root for everything received from Signal. Knows which conversation it belongs to and which domain event it represents.

public sealed record IncomingEnvelope : IEquatable<IncomingEnvelope>
Inheritance
IncomingEnvelope
Implements
Inherited Members

Constructors

IncomingEnvelope(PhoneNumber, Sender, long, EnvelopeContent)

Aggregate root for everything received from Signal. Knows which conversation it belongs to and which domain event it represents.

public IncomingEnvelope(PhoneNumber Account, Sender Source, long Timestamp, EnvelopeContent Content)

Parameters

Account PhoneNumber

The receiving account.

Source Sender

Who sent the envelope.

Timestamp long

Server timestamp of the envelope (Unix milliseconds).

Content EnvelopeContent

What the envelope carries.

Properties

Account

The receiving account.

public PhoneNumber Account { get; init; }

Property Value

PhoneNumber

Call

The content if it is a call event; otherwise null.

public CallMessage? Call { get; }

Property Value

CallMessage

Content

What the envelope carries.

public EnvelopeContent Content { get; init; }

Property Value

EnvelopeContent

Conversation

Where a reply should go: the group, or the sender for direct messages. For a SentTranscript it is the transcript's destination, because the sender is the account itself.

public Recipient Conversation { get; }

Property Value

Recipient

Data

The content if it is a data message; otherwise null.

public DataMessage? Data { get; }

Property Value

DataMessage

Edit

The content if it is an edit; otherwise null.

public EditMessage? Edit { get; }

Property Value

EditMessage

Group

The group context of a data message, edit, transcript, group story or typing indicator; null for direct conversations, calls and receipts.

public GroupId? Group { get; }

Property Value

GroupId?

IsGroup

Whether the envelope belongs to a group conversation.

public bool IsGroup { get; }

Property Value

bool

Receipt

The content if it is a receipt; otherwise null.

public ReceiptMessage? Receipt { get; }

Property Value

ReceiptMessage

ReceivedAt

public DateTimeOffset ReceivedAt { get; }

Property Value

DateTimeOffset

Source

Who sent the envelope.

public Sender Source { get; init; }

Property Value

Sender

Story

The content if it is a story; otherwise null.

public StoryMessage? Story { get; }

Property Value

StoryMessage

Timestamp

Server timestamp of the envelope (Unix milliseconds).

public long Timestamp { get; init; }

Property Value

long

Transcript

The content if it is a transcript of a message sent from another device; otherwise null.

public SentTranscript? Transcript { get; }

Property Value

SentTranscript

Typing

The content if it is a typing indicator; otherwise null.

public TypingMessage? Typing { get; }

Property Value

TypingMessage

Methods

ToDomainEvent()

The domain event represented by this envelope:

public IDomainEvent? ToDomainEvent()

Returns

IDomainEvent

The event, or null for data messages without content (e.g. an empty sync).