diff options
Diffstat (limited to 'MatrixRoomUtils.Core/RoomTypes/SpaceRoom.cs')
-rw-r--r-- | MatrixRoomUtils.Core/RoomTypes/SpaceRoom.cs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/MatrixRoomUtils.Core/RoomTypes/SpaceRoom.cs b/MatrixRoomUtils.Core/RoomTypes/SpaceRoom.cs deleted file mode 100644 index 1b93064..0000000 --- a/MatrixRoomUtils.Core/RoomTypes/SpaceRoom.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Text.Json; -using MatrixRoomUtils.Core.Extensions; -using MatrixRoomUtils.Core.Interfaces; -using MatrixRoomUtils.Core.Responses; - -namespace MatrixRoomUtils.Core.RoomTypes; - -public class SpaceRoom : GenericRoom { - private readonly AuthenticatedHomeServer _homeServer; - private readonly GenericRoom _room; - - public SpaceRoom(AuthenticatedHomeServer homeServer, string roomId) : base(homeServer, roomId) { - _homeServer = homeServer; - } - - private static SemaphoreSlim _semaphore = new(1, 1); - public async IAsyncEnumerable<GenericRoom> GetRoomsAsync(bool includeRemoved = false) { - await _semaphore.WaitAsync(); - var rooms = new List<GenericRoom>(); - var state = GetFullStateAsync(); - await foreach (var stateEvent in state) { - if (stateEvent.Type != "m.space.child") continue; - if (stateEvent.RawContent.ToJson() != "{}" || includeRemoved) - yield return await _homeServer.GetRoom(stateEvent.StateKey); - } - _semaphore.Release(); - } -} \ No newline at end of file |