diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-04 00:13:25 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-05-04 00:18:46 +0200 |
commit | b933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1 (patch) | |
tree | 4176eb2b7f1befca685d00e119d842eb3f07da1f /MatrixRoomUtils.Core/Extensions | |
parent | Small refactoring (diff) | |
download | MatrixUtils-b933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1.tar.xz |
Refactoring
Diffstat (limited to 'MatrixRoomUtils.Core/Extensions')
-rw-r--r-- | MatrixRoomUtils.Core/Extensions/HttpClientExtensions.cs | 2 | ||||
-rw-r--r-- | MatrixRoomUtils.Core/Extensions/ObjectExtensions.cs | 2 | ||||
-rw-r--r-- | MatrixRoomUtils.Core/Extensions/StringExtensions.cs | 22 |
3 files changed, 13 insertions, 13 deletions
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<string> 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<string> 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 |