about summary refs log tree commit diff
path: root/LibMatrix/Services/HomeserverResolverService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix/Services/HomeserverResolverService.cs')
-rw-r--r--LibMatrix/Services/HomeserverResolverService.cs13
1 files changed, 3 insertions, 10 deletions
diff --git a/LibMatrix/Services/HomeserverResolverService.cs b/LibMatrix/Services/HomeserverResolverService.cs

index 94a3826..ed1d2e3 100644 --- a/LibMatrix/Services/HomeserverResolverService.cs +++ b/LibMatrix/Services/HomeserverResolverService.cs
@@ -9,7 +9,9 @@ using Microsoft.Extensions.Logging.Abstractions; namespace LibMatrix.Services; public class HomeserverResolverService { - private readonly MatrixHttpClient _httpClient = new(); + private readonly MatrixHttpClient _httpClient = new() { + RetryOnNetworkError = false + }; private static readonly SemaphoreCache<WellKnownUris> WellKnownCache = new(); @@ -131,15 +133,6 @@ public class HomeserverResolverService { _logger.LogInformation("No server well-known for {server}...", homeserver); return null; } - - [Obsolete("Use authenticated media, available on AuthenticatedHomeserverGeneric", true)] - public async Task<string?> ResolveMediaUri(string homeserver, string mxc) { - if (homeserver is null) throw new ArgumentNullException(nameof(homeserver)); - if (mxc is null) throw new ArgumentNullException(nameof(mxc)); - if (!mxc.StartsWith("mxc://")) throw new InvalidDataException("mxc must start with mxc://"); - homeserver = (await ResolveHomeserverFromWellKnown(homeserver)).Client; - return mxc.Replace("mxc://", $"{homeserver}/_matrix/media/v3/download/"); - } public class WellKnownUris { public string? Client { get; set; }