about summary refs log tree commit diff
path: root/LibMatrix/Responses/SyncResponse.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix/Responses/SyncResponse.cs')
-rw-r--r--LibMatrix/Responses/SyncResponse.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs

index b2308c5..e7fe109 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs
@@ -1,4 +1,5 @@ using System.Text.Json.Serialization; +using LibMatrix.EventTypes.Spec.State; namespace LibMatrix.Responses; @@ -14,7 +15,7 @@ public class SyncResponse { public EventList? AccountData { get; set; } [JsonPropertyName("presence")] - public PresenceDataStructure? Presence { get; set; } + public EventList? Presence { get; set; } [JsonPropertyName("device_one_time_keys_count")] public Dictionary<string, int>? DeviceOneTimeKeysCount { get; set; } = null!; @@ -61,6 +62,13 @@ public class SyncResponse { [JsonPropertyName("state")] public EventList? State { get; set; } + + public override string ToString() { + var lastEvent = Timeline?.Events?.LastOrDefault(x=>x.Type == "m.room.member"); + var membership = (lastEvent?.TypedContent as RoomMemberEventContent); + return $"LeftRoomDataStructure: {lastEvent?.Sender} {membership?.Membership} ({membership?.Reason})"; + + } } public class JoinedRoomDataStructure { @@ -125,4 +133,4 @@ public class SyncResponse { public EventList? InviteState { get; set; } } } -} \ No newline at end of file +}