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