about summary refs log tree commit diff
path: root/LibMatrix/Homeservers/RemoteHomeServer.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-24 17:44:03 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-10-24 17:44:03 +0200
commit478fc1b0ef855530e1e93c5212d154280f9d7dd8 (patch)
tree3bb348b939f8d78e85337d49d3163ac5dbc8e8cc /LibMatrix/Homeservers/RemoteHomeServer.cs
parentfix synchelper null check (diff)
downloadLibMatrix-478fc1b0ef855530e1e93c5212d154280f9d7dd8.tar.xz
Minor cleanup
Diffstat (limited to 'LibMatrix/Homeservers/RemoteHomeServer.cs')
-rw-r--r--LibMatrix/Homeservers/RemoteHomeServer.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/LibMatrix/Homeservers/RemoteHomeServer.cs b/LibMatrix/Homeservers/RemoteHomeServer.cs
index e8b0cc8..a8d0326 100644
--- a/LibMatrix/Homeservers/RemoteHomeServer.cs
+++ b/LibMatrix/Homeservers/RemoteHomeServer.cs
@@ -23,17 +23,17 @@ public class RemoteHomeServer(string baseUrl) {
     public string BaseUrl { get; } = baseUrl;
     public MatrixHttpClient _httpClient { get; set; }
 
-    public async Task<ProfileResponseEventContent> GetProfileAsync(string mxid) {
+    public async Task<UserProfileResponse> GetProfileAsync(string mxid) {
         if (mxid is null) throw new ArgumentNullException(nameof(mxid));
         if (_profileCache.TryGetValue(mxid, out var value)) {
             if (value is SemaphoreSlim s) await s.WaitAsync();
-            if (value is ProfileResponseEventContent p) return p;
+            if (value is UserProfileResponse p) return p;
         }
 
         _profileCache[mxid] = new SemaphoreSlim(1);
 
         var resp = await _httpClient.GetAsync($"/_matrix/client/v3/profile/{mxid}");
-        var data = await resp.Content.ReadFromJsonAsync<ProfileResponseEventContent>();
+        var data = await resp.Content.ReadFromJsonAsync<UserProfileResponse>();
         if (!resp.IsSuccessStatusCode) Console.WriteLine("Profile: " + data);
         _profileCache[mxid] = data;