From b933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Thu, 4 May 2023 00:13:25 +0200 Subject: Refactoring --- .../Extensions/HttpClientExtensions.cs | 2 +- .../Extensions/ObjectExtensions.cs | 2 +- .../Extensions/StringExtensions.cs | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'MatrixRoomUtils.Core/Extensions') diff --git a/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs b/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs index 66a5133..8eb0226 100644 --- a/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs +++ b/MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs @@ -1,4 +1,4 @@ -namespace MatrixRoomUtils.Extensions; +namespace MatrixRoomUtils.Core.Extensions; public static class HttpClientExtensions { diff --git a/MatrixRoomUtils.Core/Extensions/ObjectExtensions.cs b/MatrixRoomUtils.Core/Extensions/ObjectExtensions.cs index cf798ce..aa1832d 100644 --- a/MatrixRoomUtils.Core/Extensions/ObjectExtensions.cs +++ b/MatrixRoomUtils.Core/Extensions/ObjectExtensions.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace MatrixRoomUtils.Extensions; +namespace MatrixRoomUtils.Core.Extensions; public static class ObjectExtensions { diff --git a/MatrixRoomUtils.Core/Extensions/StringExtensions.cs b/MatrixRoomUtils.Core/Extensions/StringExtensions.cs index 27d8265..7bed7a3 100644 --- a/MatrixRoomUtils.Core/Extensions/StringExtensions.cs +++ b/MatrixRoomUtils.Core/Extensions/StringExtensions.cs @@ -1,17 +1,17 @@ -using MatrixRoomUtils.Authentication; +using MatrixRoomUtils.Core.Authentication; -namespace MatrixRoomUtils.Extensions; +namespace MatrixRoomUtils.Core.Extensions; public static class StringExtensions { - public static async Task GetMediaUrl(this string MxcUrl) - { - //MxcUrl: mxc://rory.gay/ocRVanZoUTCcifcVNwXgbtTg - //target: https://matrix.rory.gay/_matrix/media/v3/download/rory.gay/ocRVanZoUTCcifcVNwXgbtTg - - var server = MxcUrl.Split('/')[2]; - var mediaId = MxcUrl.Split('/')[3]; - return $"{await MatrixAuth.ResolveHomeserverFromWellKnown(server)}/_matrix/media/v3/download/{server}/{mediaId}"; - } + // public static async Task GetMediaUrl(this string MxcUrl) + // { + // //MxcUrl: mxc://rory.gay/ocRVanZoUTCcifcVNwXgbtTg + // //target: https://matrix.rory.gay/_matrix/media/v3/download/rory.gay/ocRVanZoUTCcifcVNwXgbtTg + // + // var server = MxcUrl.Split('/')[2]; + // var mediaId = MxcUrl.Split('/')[3]; + // return $"{(await new RemoteHomeServer(server).Configure()).FullHomeServerDomain}/_matrix/media/v3/download/{server}/{mediaId}"; + // } } \ No newline at end of file -- cgit 1.4.1