The persona's notification policy, and what it filtered
Settings has a Notifications section, also at /notifications/filtered: what notifications from people the persona does not follow, people who do not follow it, new accounts, private mentions it did not ask for and limited accounts become (accept, filter, drop), and the filtered ones, one request per account, let in (with that account from then on) or dismissed. The Notifications tab says when requests wait. e2e: a stranger's like waits in a request reached from the tab and comes back once let in; the policy and the stranger's permission are put back afterwards (Pasture.Mongo). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
a0f07abf8c
commit
658683f816
13 files changed
+467
No files matched your search
@@ -0,0 +1,20 @@
|
||||
@page "/notifications/filtered"
|
||||
@attribute [Authorize]
|
||||
@inherits LocalizableComponentBase
|
||||
<Title>@Localizer["Filtered notifications"]</Title>
|
||||
|
||||
@* The persona's notification policy and the requests it filtered, as in Settings; the Notifications tab links here when
|
||||
requests are waiting. *@
|
||||
<section class="block relative w-full h-full neo-inset neo-xs rounded-xl">
|
||||
<div class="flex flex-col gap-4 p-4 md:p-5 w-full h-full absolute overflow-y-auto">
|
||||
<div class="flex items-center gap-2">
|
||||
<i class="ion-md-notifications-off text-lg"></i>
|
||||
<h1 class="font-bold truncate">@Localizer["Filtered notifications"]</h1>
|
||||
</div>
|
||||
<NotificationPolicyEditor />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@code {
|
||||
protected override void OnInitialized() => IsLoading = false;
|
||||
}
|
||||
@@ -32,6 +32,14 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Filter.TimelineType is TimelineType.Notifications && filteredRequests > 0)
|
||||
{
|
||||
<a class="btn btn-sm self-center" href="notifications/filtered" data-filtered-requests>
|
||||
<i class="ion-md-notifications-off"></i>
|
||||
<span>@Localizer["{0} filtered, waiting for you", filteredRequests]</span>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (pending.Count > 0)
|
||||
{
|
||||
<DButton Size="DSize.Sm" Color="DColor.Primary" class="self-center sticky top-0 z-10" OnClick="ShowPending">
|
||||
@@ -118,6 +126,8 @@
|
||||
List<ViewGroup> groups = [];
|
||||
List<MastodonList> lists = [];
|
||||
int unreadNotifications;
|
||||
// the requests the persona's notification policy filtered, shown on the Notifications tab
|
||||
int filteredRequests;
|
||||
int unreadConversations;
|
||||
string maxId;
|
||||
string minId;
|
||||
@@ -392,6 +402,7 @@
|
||||
if (newest is not null)
|
||||
await TimelineService.ReadNotificationsUpTo(newest, cancellationToken);
|
||||
unreadNotifications = 0;
|
||||
filteredRequests = (await TimelineService.NotificationPolicy(cancellationToken))?.Summary?.PendingRequestsCount ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>The stream that tells this feed's new posts, or null for a feed PrivaPub does not stream.</summary>
|
||||
|
||||
@@ -140,6 +140,26 @@
|
||||
</ChildContent>
|
||||
</DCollapse>
|
||||
|
||||
<DCollapse Icon="DCollapseIcon.Arrow">
|
||||
<Header>
|
||||
<p class="inline-flex items-center gap-2">
|
||||
<i class="ion-md-notifications text-xl"></i> <span>@Localizer["Notifications"]</span>
|
||||
</p>
|
||||
</Header>
|
||||
<ChildContent>
|
||||
<div class="block w-full p-3 md:p-4">
|
||||
@if (CascadingState.IsSignedIn)
|
||||
{
|
||||
<NotificationPolicyEditor />
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="link" href="login">@Localizer["Sign in to PrivaPub"]</a>
|
||||
}
|
||||
</div>
|
||||
</ChildContent>
|
||||
</DCollapse>
|
||||
|
||||
<DCollapse Icon="DCollapseIcon.Arrow">
|
||||
<Header>
|
||||
<p class="inline-flex items-center gap-2">
|
||||
|
||||
Reference in new issue
Block a user