@using Blazored.LocalStorage @using LibMatrix.Helpers @inject ILocalStorageService LocalStorage Room type: @if (RoomTypes.ContainsKey(roomBuilder.Type ?? "")) { @foreach (var type in RoomTypes) { } } else { } version @if (Capabilities is null) { Loading... } else { @foreach (var version in Capabilities.Capabilities.RoomVersions!.Available!) { } } Allow attribution: Allow attribution to Rory&::MatrixUtils ? @if (ShowAttributionInfo) { This will add the following to the room creation content:
{ "gay.rory.created_using": "Rory&::MatrixUtils (https://mru.rory.gay)" }
This is not visible to users unless they manually inspect the room's create event source.
} @code { [Parameter] public required RoomBuilder roomBuilder { get; set; } [Parameter] public required Action PageStateHasChanged { get; set; } [Parameter] public AuthenticatedHomeserverGeneric Homeserver { get; set; } private AuthenticatedHomeserverGeneric.CapabilitiesResponse? Capabilities { get; set; } private bool ShowAttributionInfo { get; set { field = value; StateHasChanged(); } } private bool AllowAttribution { get; set { field = value; _ = LocalStorage.SetItemAsync("rmu.room_create.allow_attribution", value); } } = true; protected override async Task OnInitializedAsync() { Capabilities = await Homeserver.GetCapabilitiesAsync(); roomBuilder.Version = Capabilities.Capabilities.RoomVersions!.Default; AllowAttribution = await LocalStorage.GetItemAsync("rmu.room_create.allow_attribution") ?? true; } private static Dictionary RoomTypes { get; } = new() { { "", "Room" }, { "m.space", "Space" }, { "support.feline.policy.lists.msc.v1", "Policy list" } }; }