about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/Authentication
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-03 18:40:53 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-03 18:40:53 +0200
commit3d3edeae16252a311704b390cfad6faa435a8b84 (patch)
tree34974194435fbe9789de5140ef9a9c0ddb834c74 /MatrixRoomUtils.Core/Authentication
parentAdd policy room discovery ,add room state viewer (diff)
downloadMatrixUtils-3d3edeae16252a311704b390cfad6faa435a8b84.tar.xz
Refactor
Diffstat (limited to 'MatrixRoomUtils.Core/Authentication')
-rw-r--r--MatrixRoomUtils.Core/Authentication/MatrixAuth.cs (renamed from MatrixRoomUtils.Core/Authentication/MatrixAccount.cs)5
1 files changed, 3 insertions, 2 deletions
diff --git a/MatrixRoomUtils.Core/Authentication/MatrixAccount.cs b/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs

index 4180df5..687ea07 100644 --- a/MatrixRoomUtils.Core/Authentication/MatrixAccount.cs +++ b/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs
@@ -4,7 +4,7 @@ using MatrixRoomUtils.Responses; namespace MatrixRoomUtils.Authentication; -public class MatrixAccount +public class MatrixAuth { public static async Task<LoginResponse> Login(string homeserver, string username, string password) { @@ -43,13 +43,14 @@ public class MatrixAccount { Console.WriteLine($"Fetching profile for {mxid} on {homeserver}..."); homeserver = await ResolveHomeserverFromWellKnown(homeserver); - var hc = new HttpClient(); + using var hc = new HttpClient(); var resp = await hc.GetAsync($"{homeserver}/_matrix/client/r0/profile/{mxid}"); var data = await resp.Content.ReadFromJsonAsync<JsonElement>(); if (!resp.IsSuccessStatusCode) Console.WriteLine("Profile: " + data.ToString()); return data.Deserialize<ProfileResponse>(); } + [Obsolete("Use IHomeServer")] public static async Task<string> ResolveHomeserverFromWellKnown(string homeserver) { using var hc = new HttpClient();