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/StringExtensions.cs | |
parent | Small refactoring (diff) | |
download | MatrixUtils-b933f7ed1189c7e14d82b4fcf5c98fb3ef4b9cf1.tar.xz |
Refactoring
Diffstat (limited to 'MatrixRoomUtils.Core/Extensions/StringExtensions.cs')
-rw-r--r-- | MatrixRoomUtils.Core/Extensions/StringExtensions.cs | 22 |
1 files changed, 11 insertions, 11 deletions
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 |