Another's profile and posts can be reported from the client (/api/v1/reports): a category, words, and for a remote account a copy to its server, which PrivaPub sends from its own actor, never naming the persona. Who liked or boosted a post opens from its card's menu (favourited_by, reblogged_by). e2e: a report from a Mastodon account's profile reaches PrivaPub's moderators forwarded, and a post's likes and boosts list the persona who gave them; the admin helper the tests share moves to Support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
@inherits LocalizableComponentBase
|
|
|
|
@* Who liked a post, or boosted it (/api/v1/statuses/:id/favourited_by, reblogged_by): the accounts PrivaPub knows to
|
|
have done so, newest first, each opening its profile. *@
|
|
<DModal IsOpen="true" IsOpenChanged="Closed" CloseText="@Localizer["Close"]" data-interacted-by="@(Boosts ? "boosts" : "likes")">
|
|
<Heading>@(Boosts ? Localizer["Boosted by"] : Localizer["Liked by"])</Heading>
|
|
<ChildContent>
|
|
@if (IsLoading)
|
|
{
|
|
<p class="flex items-center gap-2 mt-3"><DLoading Variant="DLoadingVariant.Dots" LabelText="@Localizer["loading"]" />@Localizer["loading"]</p>
|
|
}
|
|
else if (accounts.Count == 0)
|
|
{
|
|
<p class="text-sm opacity-70 mt-3">@Localizer["Nobody this server knows of."]</p>
|
|
}
|
|
<div class="flex flex-col gap-2 mt-3">
|
|
@foreach (var account in accounts)
|
|
{
|
|
<a class="flex items-center gap-3 p-2 rounded-xl neo-raised neo-2xs min-w-0" href="@($"account/{Uri.EscapeDataString(account.Id)}")" data-account="@account.Acct">
|
|
@* alt="": the name is next to it. *@
|
|
<img alt="" class="h-9 w-9 flex-none object-cover rounded-full" src="@(account.Avatar ?? "imgs/icon-192.png")" />
|
|
<span class="flex flex-col min-w-0">
|
|
<b class="truncate">@CustomEmojis.Text(account.Name, account.Emojis)</b>
|
|
<span class="text-xs opacity-70 truncate">@("@" + account.Acct)</span>
|
|
</span>
|
|
</a>
|
|
}
|
|
</div>
|
|
</ChildContent>
|
|
</DModal>
|
|
|
|
@code {
|
|
[Inject] StatusService StatusService { get; set; }
|
|
|
|
[Parameter, EditorRequired] public string StatusId { get; set; }
|
|
/// <summary>Who boosted it, rather than who liked it.</summary>
|
|
[Parameter] public bool Boosts { get; set; }
|
|
[Parameter] public EventCallback OnClosed { get; set; }
|
|
|
|
List<Account> accounts = [];
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (CascadingState.IsOffline)
|
|
{
|
|
WhenOnline(LoadData);
|
|
StartOnlinePolling();
|
|
IsLoading = false;
|
|
return;
|
|
}
|
|
|
|
await LoadData();
|
|
IsLoading = false;
|
|
}
|
|
|
|
async Task LoadData() => accounts = await StatusService.InteractedBy(StatusId, Boosts);
|
|
|
|
Task Closed(bool open) => open ? Task.CompletedTask : OnClosed.InvokeAsync();
|
|
}
|