StringExtensions.cs (589B)
1 namespace MatrixRoomUtils.Core.Extensions; 2 3 public static class StringExtensions 4 { 5 // public static async Task<string> GetMediaUrl(this string MxcUrl) 6 // { 7 // //MxcUrl: mxc://rory.gay/ocRVanZoUTCcifcVNwXgbtTg 8 // //target: https://matrix.rory.gay/_matrix/media/v3/download/rory.gay/ocRVanZoUTCcifcVNwXgbtTg 9 // 10 // var server = MxcUrl.Split('/')[2]; 11 // var mediaId = MxcUrl.Split('/')[3]; 12 // return $"{(await new RemoteHomeServer(server).Configure()).FullHomeServerDomain}/_matrix/media/v3/download/{server}/{mediaId}"; 13 // } 14 15 }