about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Services/HomeserverProviderService.cs
blob: 0f09a45dda9443aac832e34487ebfbc3d855fdfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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(_tieredStorageService, homeserver, accessToken).Configure();
    }
}