about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Core/Services/HomeserverProviderService.cs')
-rw-r--r--MatrixRoomUtils.Core/Services/HomeserverProviderService.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs b/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs
new file mode 100644
index 0000000..3db4584
--- /dev/null
+++ b/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs
@@ -0,0 +1,18 @@
+using MatrixRoomUtils.Core.Attributes;
+
+namespace MatrixRoomUtils.Core.Services;
+
+public class HomeserverProviderService {
+    private readonly TieredStorageService _tieredStorageService;
+
+    public HomeserverProviderService(TieredStorageService tieredStorageService) {
+        Console.WriteLine("Homeserver provider service instantiated!");
+        _tieredStorageService = tieredStorageService;
+        Console.WriteLine(
+            $"New HomeserverProviderService created with TieredStorageService<{string.Join(", ", tieredStorageService.GetType().GetProperties().Select(x => x.Name))}>!");
+    }
+
+    public async Task<AuthenticatedHomeServer> GetAuthenticatedWithToken(string homeserver, string accessToken) {
+        return await new AuthenticatedHomeServer(homeserver, accessToken, _tieredStorageService).Configure();
+    }
+}
\ No newline at end of file