Class Sender
The originator of a received envelope.
public sealed record Sender : IEquatable<Sender>
- Inheritance
-
Sender
- Implements
- Inherited Members
Remarks
Signal users may hide their phone number, so Number and Uuid are both optional; envelopes are only created when at least one of them is known.
Constructors
Sender(PhoneNumber?, Guid?, string?, int)
The originator of a received envelope.
public Sender(PhoneNumber? Number, Guid? Uuid, string? Name, int Device = 1)
Parameters
NumberPhoneNumber?The sender's phone number, if visible.
UuidGuid?The sender's account identifier (ACI), if known.
NamestringThe sender's profile name, if known.
DeviceintThe sending device id (1 = primary device).
Remarks
Signal users may hide their phone number, so Number and Uuid are both optional; envelopes are only created when at least one of them is known.
Properties
Device
The sending device id (1 = primary device).
public int Device { get; init; }
Property Value
Identifier
The best available identifier: the phone number, otherwise the UUID.
public string Identifier { get; }
Property Value
Exceptions
- SignalDomainException
Neither a phone number nor a UUID is known.
Name
The sender's profile name, if known.
public string? Name { get; init; }
Property Value
Number
The sender's phone number, if visible.
public PhoneNumber? Number { get; init; }
Property Value
Uuid
The sender's account identifier (ACI), if known.
public Guid? Uuid { get; init; }
Property Value
- Guid?
Methods
Matches(string)
Whether identifier identifies this sender.
public bool Matches(string identifier)
Parameters
identifierstringA phone number in any format accepted by TryParse(string?, out PhoneNumber), or a UUID.
Returns
ToRecipient()
Addresses this sender directly (by phone number if known, otherwise by UUID).
public Recipient ToRecipient()
Returns
- Recipient
A recipient for direct replies.
Exceptions
- SignalDomainException
Neither a phone number nor a UUID is known.
ToString()
Formats the sender for logs, e.g. Alice (+4915112345678).
public override string ToString()
Returns
- string
The display form of the sender.