Class MatrixLink
Link to a room, a user or an event: a matrix.to link, a matrix: URI or a bare identifier.
Implements
Inherited Members
Namespace: Uniform.Matrix.Protocol.Core
Assembly: Uniform.Matrix.Protocol.Core.dll
Syntax
public sealed record MatrixLink : IEquatable<MatrixLink>
Properties
| Edit this page View SourceEventId
Event in the room, or null.
Declaration
public string? EventId { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
IsUser
Whether the link is to a user.
Declaration
public bool IsUser { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Target
Room ID (!), room alias (#) or user ID (@).
Declaration
public string Target { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
Via
Servers to join the room through, from via parameters.
Declaration
public IReadOnlyList<string> Via { get; init; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Methods
| Edit this page View SourceEquals(MatrixLink?)
Compare by target, event and servers.
Declaration
public bool Equals(MatrixLink? other)
Parameters
| Type | Name | Description |
|---|---|---|
| MatrixLink | other |
Returns
| Type | Description |
|---|---|
| bool |
FindAll(string?)
Return the matrix.to links and matrix: URIs in text, e.g. a message body or its HTML, once each, in order.
Declaration
public static IReadOnlyList<MatrixLink> FindAll(string? text)
Parameters
| Type | Name | Description |
|---|---|---|
| string | text |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<MatrixLink> |
GetHashCode()
Hash of the target and event.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceToString()
Format as a matrix.to link.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
| Edit this page View SourceTryParse(string?, out MatrixLink?)
Parse value; false when it is not a link or identifier of a room, user or event.
Declaration
public static bool TryParse(string? value, out MatrixLink? link)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | E.g. |
| MatrixLink | link | The link. |
Returns
| Type | Description |
|---|---|
| bool |