From ae18c049338dfcb33f721eeeb0a05571e8bd87a9 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 30 May 2024 08:02:40 +0000 Subject: Rename StateEvent to LegacyMatrixEvent --- Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs | 2 +- .../LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs | 4 ++-- .../LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Utilities') diff --git a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs index c6abde2..541b720 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Interfaces/CommandContext.cs @@ -6,7 +6,7 @@ namespace LibMatrix.Utilities.Bot.Interfaces; public class CommandContext { public required GenericRoom Room { get; set; } - public required StateEventResponse MessageEvent { get; set; } + public required LegacyMatrixEventResponse MessageEvent { get; set; } public string MessageContentWithoutReply => (MessageEvent.TypedContent as RoomMessageEventContent)! diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs index 601e598..b322362 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/CommandListenerHostedService.cs @@ -90,7 +90,7 @@ public class CommandListenerHostedService : IHostedService { await _listenerTask.WaitAsync(cancellationToken); } - private async Task GetUsedPrefix(StateEventResponse evt) { + private async Task GetUsedPrefix(LegacyMatrixEventResponse evt) { var messageContent = evt.TypedContent as RoomMessageEventContent; var message = messageContent!.BodyWithoutReplyFallback; var prefix = _config.Prefixes.OrderByDescending(x => x.Length).FirstOrDefault(message.StartsWith); @@ -110,7 +110,7 @@ public class CommandListenerHostedService : IHostedService { return prefix; } - private async Task InvokeCommand(StateEventResponse evt, string usedPrefix) { + private async Task InvokeCommand(LegacyMatrixEventResponse evt, string usedPrefix) { var message = evt.TypedContent as RoomMessageEventContent; var room = _hs.GetRoom(evt.RoomId!); diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs index 7c5cc44..9d79e44 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs @@ -80,7 +80,7 @@ public class InviteHandlerHostedService : IHostedService { public class InviteEventArgs { public string RoomId { get; set; } - public StateEventResponse MemberEvent { get; set; } + public LegacyMatrixEventResponse MemberEvent { get; set; } public AuthenticatedHomeserverGeneric Homeserver { get; set; } } } \ No newline at end of file -- cgit 1.4.1