about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Web/Shared')
-rw-r--r--MatrixRoomUtils.Web/Shared/InlineUserItem.razor7
-rw-r--r--MatrixRoomUtils.Web/Shared/RoomList.razor5
-rw-r--r--MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor3
-rw-r--r--MatrixRoomUtils.Web/Shared/RoomListItem.razor11
-rw-r--r--MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor2
-rw-r--r--MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomCreateItem.razor2
-rw-r--r--MatrixRoomUtils.Web/Shared/UserListItem.razor7
7 files changed, 16 insertions, 21 deletions
diff --git a/MatrixRoomUtils.Web/Shared/InlineUserItem.razor b/MatrixRoomUtils.Web/Shared/InlineUserItem.razor
index af2fa29..e82b505 100644
--- a/MatrixRoomUtils.Web/Shared/InlineUserItem.razor
+++ b/MatrixRoomUtils.Web/Shared/InlineUserItem.razor
@@ -1,6 +1,5 @@
-@using LibMatrix.StateEventTypes
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix
+@using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.Helpers
 @using LibMatrix.Homeservers
 <div style="background-color: #ffffff11; border-radius: 0.5em; height: 1em; display: inline-block; vertical-align: middle;" alt="@UserId">
@@ -58,11 +57,11 @@
         }
 
         if (User is null && UserId is not null) {
-            User ??= await HomeServer.GetProfile(UserId);
+            User ??= await HomeServer.GetProfileAsync(UserId);
         }
 
 
-        ProfileAvatar ??= MediaResolver.ResolveMediaUri(HomeServer.FullHomeServerDomain, User.AvatarUrl);
+        ProfileAvatar ??= await hsResolver.ResolveMediaUri(HomeServer.FullHomeServerDomain, User.AvatarUrl);
         ProfileName ??= User.DisplayName;
 
         _semaphoreSlim.Release();
diff --git a/MatrixRoomUtils.Web/Shared/RoomList.razor b/MatrixRoomUtils.Web/Shared/RoomList.razor
index b0548cb..91ebb0b 100644
--- a/MatrixRoomUtils.Web/Shared/RoomList.razor
+++ b/MatrixRoomUtils.Web/Shared/RoomList.razor
@@ -1,9 +1,8 @@
 @using MatrixRoomUtils.Web.Shared.RoomListComponents;
-@using LibMatrix.StateEventTypes
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix
 @using LibMatrix.Extensions
 @using ArcaneLibs.Extensions
+@using LibMatrix.EventTypes.Spec.State
 @if(Rooms.Count != RoomsWithTypes.Sum(x=>x.Value.Count)) {
     <p>Fetching room details... @RoomsWithTypes.Sum(x=>x.Value.Count) out of @Rooms.Count done!</p>
     @foreach (var category in RoomsWithTypes.OrderBy(x => x.Value.Count)) {
@@ -29,7 +28,7 @@ else {
         var hs = await MRUStorage.GetCurrentSessionOrNavigate();
         if (hs is null) return;
 
-        GlobalProfile ??= await hs.GetProfile(hs.WhoAmI.UserId);
+        GlobalProfile ??= await hs.GetProfileAsync(hs.WhoAmI.UserId);
         if (RoomsWithTypes.Any()) return;
 
         var tasks = Rooms.Select(ProcessRoom);
diff --git a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor
index d717186..27084cc 100644
--- a/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor
+++ b/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor
@@ -1,7 +1,6 @@
-@using LibMatrix.StateEventTypes
 @using MatrixRoomUtils.Web.Classes.Constants
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix
+@using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.Homeservers
 <details>
     <summary>@roomType (@rooms.Count)</summary>
diff --git a/MatrixRoomUtils.Web/Shared/RoomListItem.razor b/MatrixRoomUtils.Web/Shared/RoomListItem.razor
index b74643b..d83568e 100644
--- a/MatrixRoomUtils.Web/Shared/RoomListItem.razor
+++ b/MatrixRoomUtils.Web/Shared/RoomListItem.razor
@@ -1,16 +1,15 @@
 @using System.Text.Json
 @using LibMatrix
+@using LibMatrix.EventTypes.Spec.State
 @using LibMatrix.Helpers
 @using LibMatrix.Homeservers
 @using LibMatrix.RoomTypes
-@using LibMatrix.StateEventTypes.Spec
-@using LibMatrix.StateEventTypes
 @using MatrixRoomUtils.Web.Classes.Constants
 <div class="roomListItem" id="@RoomId" style="background-color: #ffffff11; border-radius: 25px; margin: 8px; width: fit-Content; @(hasDangerousRoomVersion ? "border: red 4px solid;" : hasOldRoomVersion ? "border: #FF0 1px solid;" : "")">
     @if (OwnMemberState != null) {
         <img class="imageUnloaded @(string.IsNullOrWhiteSpace(OwnMemberState?.AvatarUrl ?? GlobalProfile?.AvatarUrl) ? "" : "imageLoaded")"
              style="@(ChildContent is not null ? "vertical-align: baseline;" : "") width: 32px; height: 32px; border-radius: 50%; @(OwnMemberState?.AvatarUrl != GlobalProfile?.AvatarUrl ? "border-color: red; border-width: 3px; border-style: dashed;" : "")"
-             src="@MediaResolver.ResolveMediaUri(hs.FullHomeServerDomain, OwnMemberState.AvatarUrl ?? GlobalProfile.AvatarUrl ?? "/icon-192.png")"/>
+             src="@hsResolver.ResolveMediaUri(hs.FullHomeServerDomain, OwnMemberState.AvatarUrl ?? GlobalProfile.AvatarUrl ?? "/icon-192.png").Result"/>
         <span style="vertical-align: middle; margin-right: 8px; border-radius: 75px; @(OwnMemberState?.AvatarUrl != GlobalProfile?.AvatarUrl ? "background-color: red;" : "")">
             @(OwnMemberState?.Displayname ?? GlobalProfile?.DisplayName ?? "Loading...")
         </span>
@@ -77,7 +76,7 @@
         if(Room is not null) RoomId = Room.RoomId;
 
         //sweep from id to roominfo
-        if(RoomId is not null) Room ??= await hs.GetRoom(RoomId);
+        if(RoomId is not null) Room ??= hs.GetRoom(RoomId);
         if(Room is not null) RoomInfo ??= new RoomInfo {
             Room = Room
         };
@@ -104,7 +103,7 @@
         if (!ShowOwnProfile) return;
         try {
             OwnMemberState ??= (await RoomInfo.GetStateEvent("m.room.member", hs.UserId)).TypedContent as RoomMemberEventContent;
-            GlobalProfile ??= await hs.GetProfile(hs.UserId);
+            GlobalProfile ??= await hs.GetProfileAsync(hs.UserId);
         }
         catch (MatrixException e) {
             if (e is { ErrorCode: "M_FORBIDDEN" }) {
@@ -138,7 +137,7 @@
 
             var state = (await RoomInfo.GetStateEvent("m.room.avatar")).TypedContent as RoomAvatarEventContent;
             if (state?.Url is { } url) {
-                roomIcon = MediaResolver.ResolveMediaUri(hs.FullHomeServerDomain, url);
+                roomIcon = await hsResolver.ResolveMediaUri(hs.FullHomeServerDomain, url);
                 // Console.WriteLine($"Got avatar for room {RoomId}: {roomIcon} ({url})");
             }
         }
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor
index c450211..27c636f 100644
--- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor
+++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineMemberItem.razor
@@ -1,6 +1,6 @@
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix.Extensions
 @using ArcaneLibs.Extensions
+@using LibMatrix.EventTypes.Spec.State
 @inherits BaseTimelineItem
 
 @if (roomMemberData is not null) {
diff --git a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomCreateItem.razor b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomCreateItem.razor
index 9c48455..ff77726 100644
--- a/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomCreateItem.razor
+++ b/MatrixRoomUtils.Web/Shared/TimelineComponents/TimelineRoomCreateItem.razor
@@ -1,6 +1,6 @@
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix.Extensions
 @using ArcaneLibs.Extensions
+@using LibMatrix.EventTypes.Spec.State
 @inherits BaseTimelineItem
 
 <p>
diff --git a/MatrixRoomUtils.Web/Shared/UserListItem.razor b/MatrixRoomUtils.Web/Shared/UserListItem.razor
index 7a55380..7c439cd 100644
--- a/MatrixRoomUtils.Web/Shared/UserListItem.razor
+++ b/MatrixRoomUtils.Web/Shared/UserListItem.razor
@@ -1,6 +1,5 @@
-@using LibMatrix.StateEventTypes
-@using LibMatrix.StateEventTypes.Spec
 @using LibMatrix.Helpers
+@using LibMatrix.EventTypes.Spec.State
 <div style="background-color: #ffffff11; border-radius: 25px; margin: 8px; width: fit-Content;">
     <img style="@(ChildContent is not null ? "vertical-align: baseline;" : "") width: 32px; height:  32px; border-radius: 50%;" src="@profileAvatar"/>
     <span style="vertical-align: middle; margin-right: 8px; border-radius: 75px;">@profileName</span>
@@ -41,11 +40,11 @@
             if (UserId == null) {
                 throw new ArgumentNullException(nameof(UserId));
             }
-            User = await hs.GetProfile(UserId);
+            User = await hs.GetProfileAsync(UserId);
         }
 
     // UserId = User.;
-        profileAvatar = MediaResolver.ResolveMediaUri(hs.FullHomeServerDomain, User.AvatarUrl);
+        profileAvatar = await hsResolver.ResolveMediaUri(hs.FullHomeServerDomain, User.AvatarUrl);
         profileName = User.DisplayName;
 
         _semaphoreSlim.Release();