1 files changed, 17 insertions, 2 deletions
diff --git a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
index c729a44..f2b3292 100644
--- a/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
+++ b/LibMatrix/Homeservers/AuthenticatedHomeserverGeneric.cs
@@ -48,7 +48,6 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver {
public HsNamedCaches NamedCaches { get; set; } = null!;
public GenericRoom GetRoom(string roomId) {
- if (roomId is null || !roomId.StartsWith("!")) throw new ArgumentException("Room ID must start with !", nameof(roomId));
return new GenericRoom(this, roomId);
}
@@ -186,6 +185,17 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver {
#endregion
+#region MSC 4133
+
+ public async Task UpdateProfilePropertyAsync(string name, object? value) {
+ var caps = await GetCapabilitiesAsync();
+ if(caps is null) throw new Exception("Failed to get capabilities");
+
+ }
+
+#endregion
+
+ [Obsolete("This method assumes no support for MSC 4069 and MSC 4133")]
public async Task UpdateProfileAsync(UserProfileResponse? newProfile, bool preserveCustomRoomProfile = true) {
if (newProfile is null) return;
Console.WriteLine($"Updating profile for {WhoAmI.UserId} to {newProfile.ToJson(ignoreNull: true)} (preserving room profiles: {preserveCustomRoomProfile})");
@@ -393,7 +403,7 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver {
Console.WriteLine($"Failed to get capabilities: {await res.Content.ReadAsStringAsync()}");
throw new InvalidDataException($"Failed to get capabilities: {await res.Content.ReadAsStringAsync()}");
}
-
+
return await res.Content.ReadFromJsonAsync<JsonObject>();
}
@@ -406,4 +416,9 @@ public class AuthenticatedHomeserverGeneric : RemoteHomeserver {
public NamedFilterCache FilterCache { get; init; }
public NamedFileCache FileCache { get; init; }
}
+
+ private class CapabilitiesResponse {
+ [JsonPropertyName("capabilities")]
+ public Dictionary<string, object>? Capabilities { get; set; }
+ }
}
\ No newline at end of file
|