diff options
author | Rory& <root@rory.gay> | 2024-05-30 09:46:43 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-30 09:46:43 +0000 |
commit | 30a0868789466012bab869af4300aef5a9cac108 (patch) | |
tree | 12790166e4d2c01a141928143b9b4d96dd08ace8 /LibMatrix.LegacyEvents.EventTypes/LegacyEventContent.cs | |
parent | Clarify LegacyEvent types (diff) | |
download | LibMatrix-30a0868789466012bab869af4300aef5a9cac108.tar.xz |
Rename legacy event types
Diffstat (limited to '')
-rw-r--r-- | LibMatrix.LegacyEvents.EventTypes/LegacyEventContent.cs (renamed from LibMatrix.LegacyEvents.EventTypes/EventContent.cs) | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/LibMatrix.LegacyEvents.EventTypes/EventContent.cs b/LibMatrix.LegacyEvents.EventTypes/LegacyEventContent.cs index 3e76459..002a85f 100644 --- a/LibMatrix.LegacyEvents.EventTypes/EventContent.cs +++ b/LibMatrix.LegacyEvents.EventTypes/LegacyEventContent.cs @@ -4,18 +4,18 @@ using System.Text.Json.Serialization; namespace LibMatrix.LegacyEvents.EventTypes; -public abstract class EventContent; +public abstract class LegacyEventContent; -public class UnknownEventContent : TimelineEventContent; +public class UnknownLegacyEventContent : TimelineLegacyEventContent; -public abstract class TimelineEventContent : EventContent { +public abstract class TimelineLegacyEventContent : LegacyEventContent { [JsonPropertyName("m.relates_to")] public MessageRelatesTo? RelatesTo { get; set; } [JsonPropertyName("m.new_content")] public JsonObject? NewContent { get; set; } - public TimelineEventContent SetReplaceRelation(string eventId) { + public TimelineLegacyEventContent SetReplaceRelation(string eventId) { NewContent = JsonSerializer.SerializeToNode(this, GetType())!.AsObject(); // NewContent = JsonSerializer.Deserialize(jsonText, GetType()); RelatesTo = new MessageRelatesTo { @@ -25,7 +25,7 @@ public abstract class TimelineEventContent : EventContent { return this; } - public T SetReplaceRelation<T>(string eventId) where T : TimelineEventContent => SetReplaceRelation(eventId) as T ?? throw new InvalidOperationException(); + public T SetReplaceRelation<T>(string eventId) where T : TimelineLegacyEventContent => SetReplaceRelation(eventId) as T ?? throw new InvalidOperationException(); public class MessageRelatesTo { [JsonPropertyName("m.in_reply_to")] |