Table of Contents

Class OutgoingMessage

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

An immutable, validated message to send. Build it with Create() or To(params IEnumerable<Recipient>) and the fluent OutgoingMessageBuilder.

public sealed class OutgoingMessage
Inheritance
OutgoingMessage
Inherited Members

Examples

var message = OutgoingMessage.To(PhoneNumber.Parse("+4915112345678"))
    .WithStyledText("**Hello**")
    .WithAttachment(bytes, "image/png", "chart.png")
    .Build();

Properties

Attachments

Attachments as base64 or data URIs (data:<mime>;filename=<name>;base64,<data>).

public IReadOnlyList<string> Attachments { get; }

Property Value

IReadOnlyList<string>

EditTimestamp

Timestamp of a previously sent message to edit; null for a new message.

public long? EditTimestamp { get; }

Property Value

long?

LinkPreview

The link preview for a URL in Text, if any.

public LinkPreview? LinkPreview { get; }

Property Value

LinkPreview

Mentions

Mentions inside Text.

public IReadOnlyList<Mention> Mentions { get; }

Property Value

IReadOnlyList<Mention>

NotifySelf

Whether the sending account's other devices should notify; null uses the API default.

public bool? NotifySelf { get; }

Property Value

bool?

Quote

The message being replied to, if any.

public Quote? Quote { get; }

Property Value

Quote

Recipients

The recipients (at least one, without duplicates).

public IReadOnlyList<Recipient> Recipients { get; }

Property Value

IReadOnlyList<Recipient>

Sticker

The sticker to send, if any. Never combined with Attachments.

public Sticker? Sticker { get; }

Property Value

Sticker?

Text

The message body, if any.

public string? Text { get; }

Property Value

string

TextMode

How Text is interpreted.

public TextMode TextMode { get; }

Property Value

TextMode

ViewOnce

Whether the message can be viewed only once.

public bool ViewOnce { get; }

Property Value

bool

Methods

Create()

Starts building a message without recipients.

public static OutgoingMessageBuilder Create()

Returns

OutgoingMessageBuilder

A new builder.

To(params IEnumerable<Recipient>)

Starts building a message to the given recipients.

public static OutgoingMessageBuilder To(params IEnumerable<Recipient> recipients)

Parameters

recipients IEnumerable<Recipient>

The recipients. Phone numbers and group ids convert implicitly.

Returns

OutgoingMessageBuilder

A new builder.