diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/Rooms')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/Create.razor | 18 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/Index.razor | 2 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor | 4 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/Timeline.razor | 10 |
4 files changed, 17 insertions, 17 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Create.razor b/MatrixRoomUtils.Web/Pages/Rooms/Create.razor index 04dcdcc..5823757 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/Create.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/Create.razor @@ -42,7 +42,7 @@ } else { <FancyTextBox @bind-Value="@creationEvent.Name"></FancyTextBox> - <p>(#<FancyTextBox @bind-Value="@creationEvent.RoomAliasName"></FancyTextBox>:@HomeServer.WhoAmI.UserId.Split(':').Last())</p> + <p>(#<FancyTextBox @bind-Value="@creationEvent.RoomAliasName"></FancyTextBox>:@Homeserver.WhoAmI.UserId.Split(':').Last())</p> } </td> </tr> @@ -88,7 +88,7 @@ <tr> <td>Room icon:</td> <td> - <img src="@hsResolver.ResolveMediaUri(HomeServer.ServerName, roomAvatarEvent.Url)" style="width: 128px; height: 128px; border-radius: 50%;"/> + <img src="@hsResolver.ResolveMediaUri(Homeserver.ServerName, roomAvatarEvent.Url)" style="width: 128px; height: 128px; border-radius: 50%;"/> <div style="display: inline-block; vertical-align: middle;"> <FancyTextBox @bind-Value="@roomAvatarEvent.Url"></FancyTextBox><br/> <InputFile OnChange="RoomIconFilePicked"></InputFile> @@ -156,7 +156,7 @@ <details> <summary>@creationEvent.InitialState.Count(x => x.Type == "m.room.member") members</summary> @* <button @onclick="() => { RuntimeCache.LoginSessions.Select(x => x.Value.LoginResponse.UserId).ToList().ForEach(InviteMember); }">Invite all logged in accounts</button> *@ - @foreach (var member in creationEvent.InitialState.Where(x => x.Type == "m.room.member" && x.StateKey != HomeServer.UserId)) { + @foreach (var member in creationEvent.InitialState.Where(x => x.Type == "m.room.member" && x.StateKey != Homeserver.UserId)) { <UserListItem UserId="@member.StateKey"></UserListItem> } </details> @@ -249,7 +249,7 @@ private CreateRoomRequest? creationEvent { get; set; } private Dictionary<string, CreateRoomRequest>? Presets { get; set; } = new(); - private AuthenticatedHomeserverGeneric? HomeServer { get; set; } + private AuthenticatedHomeserverGeneric? Homeserver { get; set; } private MatrixException? _matrixException { get; set; } @@ -259,8 +259,8 @@ private RoomAvatarEventContent? roomAvatarEvent => creationEvent?["m.room.avatar"].TypedContent as RoomAvatarEventContent; protected override async Task OnInitializedAsync() { - HomeServer = await MRUStorage.GetCurrentSessionOrNavigate(); - if (HomeServer is null) return; + Homeserver = await MRUStorage.GetCurrentSessionOrNavigate(); + if (Homeserver is null) return; foreach (var x in Assembly.GetExecutingAssembly().GetTypes().Where(x => x.IsClass && !x.IsAbstract && x.GetInterfaces().Contains(typeof(IRoomCreationTemplate))).ToList()) { Console.WriteLine($"Found room creation template in class: {x.FullName}"); @@ -280,7 +280,7 @@ private void JsonChanged() => Console.WriteLine(creationEvent.ToJson()); private async Task RoomIconFilePicked(InputFileChangeEventArgs obj) { - var res = await HomeServer.UploadFile(obj.File.Name, obj.File.OpenReadStream(), obj.File.ContentType); + var res = await Homeserver.UploadFile(obj.File.Name, obj.File.OpenReadStream(), obj.File.ContentType); Console.WriteLine(res); (creationEvent["m.room.avatar"].TypedContent as RoomAvatarEventContent).Url = res; StateHasChanged(); @@ -291,7 +291,7 @@ Console.WriteLine(creationEvent.ToJson()); creationEvent.CreationContent.Add("rory.gay.created_using", "Rory&::MatrixRoomUtils (https://mru.rory.gay)"); try { - var id = await HomeServer.CreateRoom(creationEvent); + var id = await Homeserver.CreateRoom(creationEvent); } catch (MatrixException e) { _matrixException = e; @@ -299,7 +299,7 @@ } private void InviteMember(string mxid) { - if (!creationEvent.InitialState.Any(x => x.Type == "m.room.member" && x.StateKey == mxid) && HomeServer.UserId != mxid) + if (!creationEvent.InitialState.Any(x => x.Type == "m.room.member" && x.StateKey == mxid) && Homeserver.UserId != mxid) creationEvent.InitialState.Add(new StateEvent { Type = "m.room.member", StateKey = mxid, diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor index 516e9ca..fd32cb3 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor @@ -208,7 +208,7 @@ joinedRoom.Value.State.Events.RemoveAll(x => x.Type == "m.room.member" && x.StateKey != Homeserver.WhoAmI?.UserId); // We can't trust servers to give us what we ask for, and this ruins performance // Thanks, Conduit. - joinedRoom.Value.State.Events.RemoveAll(x => filter.Room?.State?.Types?.Contains(x.Type) ?? false); + joinedRoom.Value.State.Events.RemoveAll(x => filter.Room?.State?.Types?.Contains(x.Type) == false); if(filter.Room?.State?.NotSenders?.Any() ?? false) joinedRoom.Value.State.Events.RemoveAll(x => filter.Room?.State?.NotSenders?.Contains(x.Sender) ?? false); diff --git a/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor b/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor index 3cc6a15..adedbd3 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor @@ -192,7 +192,7 @@ else { private bool _enableAvatars; static readonly Dictionary<string, string?> avatars = new(); - static readonly Dictionary<string, RemoteHomeServer> servers = new(); + static readonly Dictionary<string, RemoteHomeserver> servers = new(); public static List<StateEventResponse> PolicyEvents { get; set; } = new(); @@ -229,7 +229,7 @@ else { try { if (avatars.ContainsKey(userId)) return; var hs = userId.Split(':')[1]; - var server = servers.ContainsKey(hs) ? servers[hs] : new RemoteHomeServer(userId.Split(':')[1]); + var server = servers.ContainsKey(hs) ? servers[hs] : new RemoteHomeserver(userId.Split(':')[1]); if (!servers.ContainsKey(hs)) servers.Add(hs, server); var profile = await server.GetProfileAsync(userId); avatars.Add(userId, await hsResolver.ResolveMediaUri(server.BaseUrl, profile.AvatarUrl)); diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Timeline.razor b/MatrixRoomUtils.Web/Pages/Rooms/Timeline.razor index e22be4a..1f4a923 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/Timeline.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/Timeline.razor @@ -11,7 +11,7 @@ @foreach (var evt in Events) { <div type="@evt.Type" key="@evt.StateKey" itemid="@evt.EventId"> <DynamicComponent Type="@ComponentType(evt)" - Parameters="@(new Dictionary<string, object> { { "Event", evt }, { "Events", Events }, { "HomeServer", HomeServer!} })"> + Parameters="@(new Dictionary<string, object> { { "Event", evt }, { "Events", Events }, { "Homeserver", Homeserver!} })"> </DynamicComponent> </div> } @@ -24,13 +24,13 @@ private List<MessagesResponse> Messages { get; } = new(); private List<StateEventResponse> Events { get; } = new(); - private AuthenticatedHomeserverGeneric? HomeServer { get; set; } + private AuthenticatedHomeserverGeneric? Homeserver { get; set; } protected override async Task OnInitializedAsync() { Console.WriteLine("RoomId: " + RoomId); - HomeServer = await MRUStorage.GetCurrentSessionOrNavigate(); - if (HomeServer is null) return; - var room = HomeServer.GetRoom(RoomId); + Homeserver = await MRUStorage.GetCurrentSessionOrNavigate(); + if (Homeserver is null) return; + var room = Homeserver.GetRoom(RoomId); MessagesResponse? msgs = null; do { msgs = await room.GetMessagesAsync(limit: 1000, from: msgs?.End, dir: "b"); |