about summary refs log tree commit diff
path: root/Utilities/LibMatrix.Utilities.Bot
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-03-13 11:50:01 +0100
committerRory& <root@rory.gay>2025-03-13 11:50:01 +0100
commit08b552fc3ad6e81d8ebddc238043681da90673b3 (patch)
tree7186fa94059a64ee34a3e7ba78fb00a95648b345 /Utilities/LibMatrix.Utilities.Bot
parentAdd more bot stuff (diff)
downloadLibMatrix-08b552fc3ad6e81d8ebddc238043681da90673b3.tar.xz
Add full invite data to invite handler callback
Diffstat (limited to 'Utilities/LibMatrix.Utilities.Bot')
-rw-r--r--Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs

index cac9ca4..f819cc3 100644 --- a/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs +++ b/Utilities/LibMatrix.Utilities.Bot/Services/InviteListenerHostedService.cs
@@ -1,6 +1,7 @@ using LibMatrix.Filters; using LibMatrix.Helpers; using LibMatrix.Homeservers; +using LibMatrix.Responses; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; @@ -51,7 +52,8 @@ public class InviteHandlerHostedService : IHostedService { var inviteEventArgs = new InviteEventArgs() { RoomId = invite.Key, - MemberEvent = invite.Value.InviteState.Events.First(x => x.Type == "m.room.member" && x.StateKey == _hs.WhoAmI.UserId), + InviteData = invite.Value, + MemberEvent = invite.Value.InviteState?.Events?.First(x => x.Type == "m.room.member" && x.StateKey == _hs.WhoAmI.UserId), Homeserver = _hs }; await _inviteHandler(inviteEventArgs); @@ -74,11 +76,12 @@ public class InviteHandlerHostedService : IHostedService { public class InviteEventArgs { public string RoomId { get; set; } - public StateEventResponse MemberEvent { get; set; } public AuthenticatedHomeserverGeneric Homeserver { get; set; } + public StateEventResponse MemberEvent { get; set; } + public SyncResponse.RoomsDataStructure.InvitedRoomDataStructure InviteData { get; set; } } public interface IInviteHandler { - public Task HandleInviteAsync(InviteEventArgs args); + public Task HandleInviteAsync(InviteEventArgs invite); } } \ No newline at end of file