diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-26 02:43:54 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-27 17:43:00 +0200 |
commit | 3ed00f732a284b5a3e96e52d4e3a71869135869b (patch) | |
tree | 308cdd5c9891a676dc55cbf0e0e998ab5a74b2d2 /MatrixRoomUtils.Core/RemoteHomeServer.cs | |
parent | Working state, refactored Rory&::LibMatrix (diff) | |
download | MatrixUtils-3ed00f732a284b5a3e96e52d4e3a71869135869b.tar.xz |
Dependency injection stuff
Diffstat (limited to 'MatrixRoomUtils.Core/RemoteHomeServer.cs')
-rw-r--r-- | MatrixRoomUtils.Core/RemoteHomeServer.cs | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/MatrixRoomUtils.Core/RemoteHomeServer.cs b/MatrixRoomUtils.Core/RemoteHomeServer.cs index 3f50d2e..c593318 100644 --- a/MatrixRoomUtils.Core/RemoteHomeServer.cs +++ b/MatrixRoomUtils.Core/RemoteHomeServer.cs @@ -21,20 +21,4 @@ public class RemoteHomeServer : IHomeServer { return this; } - - public async Task<Room> GetRoom(string roomId) => new Room(_httpClient, roomId); - - public async Task<List<Room>> GetJoinedRooms() { - var rooms = new List<Room>(); - var roomQuery = await _httpClient.GetAsync("/_matrix/client/v3/joined_rooms"); - if (!roomQuery.IsSuccessStatusCode) { - Console.WriteLine($"Failed to get rooms: {await roomQuery.Content.ReadAsStringAsync()}"); - throw new InvalidDataException($"Failed to get rooms: {await roomQuery.Content.ReadAsStringAsync()}"); - } - - var roomsJson = await roomQuery.Content.ReadFromJsonAsync<JsonElement>(); - foreach (var room in roomsJson.GetProperty("joined_rooms").EnumerateArray()) rooms.Add(new Room(_httpClient, room.GetString())); - - return rooms; - } } \ No newline at end of file |