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

- /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:
mattandClaude Opus 5.5 committed 2026-09-25 21:42:29 +01:00
1 parent 142dc13fea
commit a90cd14f59
12 files changed
+1083 -18

No files matched your search

+461 -3
View File
@@ -1942,7 +1942,7 @@
}
},
"summary": "Change your sharing settings",
"description": "Turning sharing on makes you findable as your handle. Your handle can't change once\npeople follow you. Visibility changes apply to new posts only.",
"description": "Turning sharing on makes you findable as your handle. Your handle can't change once\npeople follow you. Visibility changes apply to new posts only. Turning sharing off\nremoves all your followers (each is told).",
"tags": [
"Federation"
],
@@ -1998,6 +1998,391 @@
}
]
},
"/api/v1/federation/followers": {
"get": {
"parameters": [
{
"in": "query",
"name": "state",
"schema": {
"type": [
"string",
"null"
],
"default": null,
"enum": [
"pending",
"accepted",
null
]
},
"required": false
}
],
"responses": {
"422": {
"$ref": "#/components/responses/UNPROCESSABLE_CONTENT"
},
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Follower"
}
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Your followers and follow requests",
"description": "Newest first. Filter with `state=pending` (requests) or `state=accepted`.",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/v1/federation/followers/{follower_id}/approve": {
"post": {
"responses": {
"409": {
"description": "Not a pending request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "No such follower",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Follower"
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Approve a follow request",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
},
"parameters": [
{
"in": "path",
"name": "follower_id",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
}
}
]
},
"/api/v1/federation/followers/{follower_id}/decline": {
"post": {
"responses": {
"404": {
"description": "No such follower",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "No Content"
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Decline a follow request",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
},
"parameters": [
{
"in": "path",
"name": "follower_id",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
}
}
]
},
"/api/v1/federation/followers/{follower_id}/remove": {
"post": {
"responses": {
"404": {
"description": "No such follower",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "No Content"
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Remove a follower",
"description": "They stop receiving your posts. They can follow you again; block them to prevent it.",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
},
"parameters": [
{
"in": "path",
"name": "follower_id",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
}
}
]
},
"/api/v1/federation/followers/{follower_id}/block": {
"post": {
"responses": {
"404": {
"description": "No such follower",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "No Content"
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Block a follower",
"description": "Removes them and refuses their future follows.",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
},
"parameters": [
{
"in": "path",
"name": "follower_id",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
}
}
]
},
"/api/v1/federation/blocks": {
"get": {
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Block"
}
}
}
}
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Accounts you've blocked",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
}
},
"/api/v1/federation/blocks/{block_id}": {
"delete": {
"responses": {
"404": {
"description": "No such block",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"204": {
"description": "No Content"
},
"401": {
"description": "Not authenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"$ref": "#/components/responses/DEFAULT_ERROR"
}
},
"summary": "Unblock an account",
"description": "They can follow you again (they aren't re-added).",
"tags": [
"Federation"
],
"security": [
{
"bearerAuth": []
}
]
},
"parameters": [
{
"in": "path",
"name": "block_id",
"required": true,
"schema": {
"type": "integer",
"minimum": 0
}
}
]
},
"/.well-known/webfinger": {
"get": {
"tags": [
@@ -3693,7 +4078,12 @@
"followers": {
"type": "integer",
"readOnly": true,
"description": "0 until following arrives"
"description": "Accepted followers"
},
"pending_followers": {
"type": "integer",
"readOnly": true,
"description": "Waiting for approval"
}
},
"additionalProperties": false
@@ -3755,7 +4145,12 @@
"followers": {
"type": "integer",
"readOnly": true,
"description": "0 until following arrives"
"description": "Accepted followers"
},
"pending_followers": {
"type": "integer",
"readOnly": true,
"description": "Waiting for approval"
}
},
"additionalProperties": false
@@ -3784,6 +4179,69 @@
}
},
"additionalProperties": false
},
"Follower": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"state": {
"type": "string",
"enum": [
"pending",
"accepted"
]
},
"handle": {
"type": "string",
"example": "@bob@mastodon.example"
},
"display_name": {
"type": [
"string",
"null"
]
},
"actor_url": {
"type": "string"
},
"server": {
"type": "string",
"example": "mastodon.example"
},
"since": {
"type": "string",
"format": "date-time",
"description": "When they followed (or asked to)"
}
},
"additionalProperties": false
},
"Block": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"handle": {
"type": "string"
},
"display_name": {
"type": [
"string",
"null"
]
},
"actor_url": {
"type": "string"
},
"since": {
"type": "string",
"format": "date-time"
}
},
"additionalProperties": false
}
},
"responses": {