diff options
author | Rory& <root@rory.gay> | 2024-05-30 19:07:09 +0000 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-30 19:07:09 +0000 |
commit | cf90f02e1f9c9f7d037976cace2b9c49119c741c (patch) | |
tree | 3925bd8d689c3f330c217b0f867ba8a241d893e7 /LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs | |
parent | Rename legacy event types (diff) | |
download | LibMatrix-cf90f02e1f9c9f7d037976cace2b9c49119c741c.tar.xz |
Start implementing new event system
Diffstat (limited to '')
-rw-r--r-- | LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs index db76985..96e20e0 100644 --- a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs +++ b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs @@ -192,8 +192,8 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver { var oldProfile = await GetProfileAsync(WhoAmI.UserId!); Dictionary<string, RoomMemberLegacyEventContent> expectedRoomProfiles = new(); var syncHelper = new SyncHelper(this) { - Filter = new SyncFilter { - AccountData = new SyncFilter.EventFilter() { + Filter = new MatrixFilter { + AccountData = new MatrixFilter.EventFilter() { Types = new List<string> { "m.room.member" } @@ -312,7 +312,7 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver { /// <param name="filter"></param> /// <returns></returns> /// <exception cref="Exception"></exception> - public async Task<FilterIdResponse> UploadFilterAsync(SyncFilter filter) { + public async Task<FilterIdResponse> UploadFilterAsync(MatrixFilter filter) { List<List<string>?> senderLists = [ filter.AccountData?.Senders, filter.AccountData?.NotSenders, @@ -338,10 +338,10 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver { return await resp.Content.ReadFromJsonAsync<FilterIdResponse>() ?? throw new Exception("Failed to upload filter?"); } - public async Task<SyncFilter> GetFilterAsync(string filterId) { + public async Task<MatrixFilter> GetFilterAsync(string filterId) { if (_filterCache.TryGetValue(filterId, out var filter)) return filter; var resp = await ClientHttpClient.GetAsync("/_matrix/client/v3/user/" + UserId + "/filter/" + filterId); - return _filterCache[filterId] = await resp.Content.ReadFromJsonAsync<SyncFilter>() ?? throw new Exception("Failed to get filter?"); + return _filterCache[filterId] = await resp.Content.ReadFromJsonAsync<MatrixFilter>() ?? throw new Exception("Failed to get filter?"); } public class FilterIdResponse { @@ -385,7 +385,7 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver { } private Dictionary<string, string>? _namedFilterCache; - private Dictionary<string, SyncFilter> _filterCache = new(); + private Dictionary<string, MatrixFilter> _filterCache = new(); public async Task<JsonObject?> GetCapabilitiesAsync() { var res = await ClientHttpClient.GetAsync("/_matrix/client/v3/capabilities"); |