diff options
author | Rory& <root@rory.gay> | 2024-05-30 08:02:40 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-30 08:02:40 +0000 |
commit | ae18c049338dfcb33f721eeeb0a05571e8bd87a9 (patch) | |
tree | 9e73ae6a42a310efe43c6a9ed7d13ce19e0cbde5 /LibMatrix/Extensions | |
parent | Log warning if registering a duplicate type (diff) | |
download | LibMatrix-ae18c049338dfcb33f721eeeb0a05571e8bd87a9.tar.xz |
Rename StateEvent to LegacyMatrixEvent
Diffstat (limited to 'LibMatrix/Extensions')
-rw-r--r-- | LibMatrix/Extensions/EnumerableExtensions.cs | 4 | ||||
-rw-r--r-- | LibMatrix/Extensions/JsonElementExtensions.cs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/LibMatrix/Extensions/EnumerableExtensions.cs b/LibMatrix/Extensions/EnumerableExtensions.cs index 42d9491..b5193ab 100644 --- a/LibMatrix/Extensions/EnumerableExtensions.cs +++ b/LibMatrix/Extensions/EnumerableExtensions.cs @@ -1,7 +1,7 @@ namespace LibMatrix.Extensions; public static class EnumerableExtensions { - public static void MergeStateEventLists(this IList<StateEvent> oldState, IList<StateEvent> newState) { + public static void MergeStateEventLists(this IList<LegacyMatrixEvent> oldState, IList<LegacyMatrixEvent> newState) { foreach (var stateEvent in newState) { var old = oldState.FirstOrDefault(x => x.Type == stateEvent.Type && x.StateKey == stateEvent.StateKey); if (old is null) { @@ -14,7 +14,7 @@ public static class EnumerableExtensions { } } - public static void MergeStateEventLists(this IList<StateEventResponse> oldState, IList<StateEventResponse> newState) { + public static void MergeStateEventLists(this IList<LegacyMatrixEventResponse> oldState, IList<LegacyMatrixEventResponse> newState) { foreach (var stateEvent in newState) { var old = oldState.FirstOrDefault(x => x.Type == stateEvent.Type && x.StateKey == stateEvent.StateKey); if (old is null) { diff --git a/LibMatrix/Extensions/JsonElementExtensions.cs b/LibMatrix/Extensions/JsonElementExtensions.cs index c4ed743..a2faddc 100644 --- a/LibMatrix/Extensions/JsonElementExtensions.cs +++ b/LibMatrix/Extensions/JsonElementExtensions.cs @@ -8,7 +8,7 @@ namespace LibMatrix.Extensions; public static class JsonElementExtensions { public static bool FindExtraJsonElementFields(this JsonElement obj, Type objectType, string objectPropertyName) { if (objectPropertyName == "content" && objectType == typeof(JsonObject)) - objectType = typeof(StateEventResponse); + objectType = typeof(LegacyMatrixEventResponse); // if (t == typeof(JsonNode)) // return false; @@ -35,9 +35,9 @@ public static class JsonElementExtensions { continue; } - if (field.Name == "content" && (objectType == typeof(StateEventResponse) || objectType == typeof(StateEvent))) { + if (field.Name == "content" && (objectType == typeof(LegacyMatrixEventResponse) || objectType == typeof(LegacyMatrixEvent))) { unknownPropertyFound |= field.FindExtraJsonPropertyFieldsByValueKind( - StateEvent.GetStateEventType(obj.GetProperty("type").GetString()!), // We expect type to always be present + LegacyMatrixEvent.GetStateEventType(obj.GetProperty("type").GetString()!), // We expect type to always be present mappedProperty.PropertyType); continue; } |