diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-07-02 01:57:46 +0200 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-07-02 01:57:46 +0200 |
commit | 28f738ba433fb1012f693866dc4b3f521fd824b5 (patch) | |
tree | 86cc3381b99ca637a1986578292f60de2c097c57 /LibMatrix/RoomTypes/GenericRoom.cs | |
parent | Return null on TryGetFromJson if a JsonException happens (diff) | |
download | LibMatrix-28f738ba433fb1012f693866dc4b3f521fd824b5.tar.xz |
Authenticated media foundations
Diffstat (limited to 'LibMatrix/RoomTypes/GenericRoom.cs')
-rw-r--r-- | LibMatrix/RoomTypes/GenericRoom.cs | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/LibMatrix/RoomTypes/GenericRoom.cs b/LibMatrix/RoomTypes/GenericRoom.cs index fe2ee8d..b22ce2f 100644 --- a/LibMatrix/RoomTypes/GenericRoom.cs +++ b/LibMatrix/RoomTypes/GenericRoom.cs @@ -316,6 +316,7 @@ public class GenericRoom { public Task<RoomPowerLevelEventContent?> GetPowerLevelsAsync() => GetStateAsync<RoomPowerLevelEventContent>("m.room.power_levels"); + [Obsolete("This method will be merged into GetNameAsync() in the future.")] public async Task<string> GetNameOrFallbackAsync(int maxMemberNames = 2) { try { return await GetNameAsync(); @@ -352,22 +353,6 @@ public class GenericRoom { return Task.WhenAll(tasks); } - public async Task<string?> GetResolvedRoomAvatarUrlAsync(bool useOriginHomeserver = false) { - var avatar = await GetAvatarUrlAsync(); - if (avatar?.Url is null) return null; - if (!avatar.Url.StartsWith("mxc://")) return avatar.Url; - if (useOriginHomeserver) - try { - var hs = avatar.Url.Split('/', 3)[1]; - return await new HomeserverResolverService(NullLogger<HomeserverResolverService>.Instance).ResolveMediaUri(hs, avatar.Url); - } - catch (Exception e) { - Console.WriteLine(e); - } - - return Homeserver.ResolveMediaUri(avatar.Url); - } - #endregion #region Simple calls |