about summary refs log tree commit diff
path: root/LibMatrix.Federation/FederationTypes/FederationEvent.cs
blob: 05bdcc9b69644d7216244800808ac086ebbb1810 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Text.Json.Serialization;

namespace LibMatrix.Federation.FederationTypes;

public class FederationEvent : MatrixEventResponse {
    [JsonPropertyName("auth_events")]
    public required List<string> AuthEvents { get; set; } = [];

    [JsonPropertyName("prev_events")]
    public required List<string> PrevEvents { get; set; } = [];

    [JsonPropertyName("depth")]
    public required int Depth { get; set; }
}

public class SignedFederationEvent : FederationEvent {
    [JsonPropertyName("signatures")]
    public required Dictionary<string, Dictionary<string, string>> Signatures { get; set; } = new();

    [JsonPropertyName("hashes")]
    public required Dictionary<string, string> Hashes { get; set; } = new();
}

public class FederationEphemeralEvent {
    [JsonPropertyName("edu_type")]
    public required string Type { get; set; }

    [JsonPropertyName("content")]
    public required Dictionary<string, object> Content { get; set; } = new();
}