Manage followers from the API and web UI (phase 2, step 6)
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 11s
CI / test (push) Successful in 2m4s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 11s
CI / test (push) Successful in 2m4s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
- /api/v1/federation: list followers and requests, approve (Accept), decline or remove (Reject), block (Block, and future follows are refused), list and remove blocks; settings report follower counts - The actor now reflects the user's real follow-approval setting and the followers collection its accepted count - Turning sharing off sends every follower a Reject and forgets them; while those are being delivered the actor stays fetchable with just its key (no name or bio) so other servers can verify them, and WebFinger already says not found - Web UI: a Followers page (requests with Approve/Decline, followers with Remove/Block behind a confirm step, blocked accounts with Unblock; remote names shown as plain text only), follower counts on the Sharing page, and a confirmation before turning sharing off when that would remove followers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
142dc13fea
commit
a90cd14f59
12 files changed
+1083
-18
No files matched your search
@@ -67,3 +67,24 @@ def sharing_count() -> int:
|
||||
return db.session.scalar(
|
||||
db.select(db.func.count()).select_from(FederationSettings).filter_by(enabled=True)
|
||||
)
|
||||
|
||||
|
||||
def farewell_user(username: str):
|
||||
"""A user who has stopped sharing but still has messages on their way out (the
|
||||
Rejects telling followers). Their actor stays fetchable, minimally, so other servers
|
||||
can verify those messages. None otherwise."""
|
||||
from scrobbler.federation.models import FederationActivity, FederationDelivery
|
||||
|
||||
user = accounts.find_user(username)
|
||||
if user is None:
|
||||
return None
|
||||
settings = db.session.get(FederationSettings, user.id)
|
||||
if settings is None or settings.enabled:
|
||||
return None
|
||||
pending = db.session.scalar(
|
||||
db.select(db.func.count())
|
||||
.select_from(FederationDelivery)
|
||||
.join(FederationActivity, FederationActivity.id == FederationDelivery.activity_id)
|
||||
.filter(FederationActivity.user_id == user.id, FederationDelivery.status == "pending")
|
||||
)
|
||||
return user if pending else None
|
||||
Reference in new issue
Block a user