about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Desktop')
-rw-r--r--MatrixRoomUtils.Desktop/App.axaml.cs4
-rw-r--r--MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs10
2 files changed, 8 insertions, 6 deletions
diff --git a/MatrixRoomUtils.Desktop/App.axaml.cs b/MatrixRoomUtils.Desktop/App.axaml.cs
index 33f2c13..3963be6 100644
--- a/MatrixRoomUtils.Desktop/App.axaml.cs
+++ b/MatrixRoomUtils.Desktop/App.axaml.cs
@@ -20,8 +20,8 @@ public partial class App : Application {
             services.AddSingleton<SentryService>();
             services.AddSingleton<TieredStorageService>(x =>
                 new TieredStorageService(
-                    cacheStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>().CacheStoragePath),
-                    dataStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>().DataStoragePath)
+                    cacheStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>()!.CacheStoragePath),
+                    dataStorageProvider: new FileStorageProvider(x.GetService<MRUDesktopConfiguration>()!.DataStoragePath)
                 )
             );
             services.AddSingleton(new RoryLibMatrixConfiguration {
diff --git a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
index 6cdb767..d687679 100644
--- a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
+++ b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
@@ -2,9 +2,10 @@ using Avalonia.Controls;
 using Avalonia.Interactivity;
 using Avalonia.Media.Imaging;
 using LibMatrix;
+using LibMatrix.EventTypes.Spec.State;
 using LibMatrix.Helpers;
+using LibMatrix.Interfaces.Services;
 using LibMatrix.Services;
-using LibMatrix.StateEventTypes.Spec;
 using Microsoft.Extensions.DependencyInjection;
 
 namespace MatrixRoomUtils.Desktop.Components;
@@ -43,9 +44,10 @@ public partial class RoomListEntry : UserControl {
             if (avatarEvent?.TypedContent is RoomAvatarEventContent avatarData) {
                 var mxcUrl = avatarData.Url;
                 await using var svc = _serviceScopeFactory.CreateAsyncScope();
-                var hs = await svc.ServiceProvider.GetService<MRUStorageWrapper>().GetCurrentSessionOrPrompt();
-                var storage = svc.ServiceProvider.GetService<TieredStorageService>().CacheStorageProvider;
-                var resolvedUrl = MediaResolver.ResolveMediaUri(hs.FullHomeServerDomain, mxcUrl);
+                var hs = await svc.ServiceProvider.GetService<MRUStorageWrapper>()?.GetCurrentSessionOrPrompt()!;
+                var hsResolver = svc.ServiceProvider.GetService<HomeserverResolverService>();
+                var storage = svc.ServiceProvider.GetService<TieredStorageService>()?.CacheStorageProvider;
+                var resolvedUrl = await hsResolver.ResolveMediaUri(hs.FullHomeServerDomain, mxcUrl);
                 var storageKey = $"media/{mxcUrl.Replace("mxc://", "").Replace("/", ".")}";
                 try {
                     if (!await storage.ObjectExistsAsync(storageKey))