WIP! A BB-style forum, on the ATmosphere! We're still working... we'll be back soon when we have something to show off!
node typescript hono htmx atproto
at atb-44-reply-count-fix 68 lines 1.8 kB view raw
1meta { 2 name: Lock Topic 3 type: http 4 seq: 3 5} 6 7post { 8 url: {{appview_url}}/api/mod/lock 9} 10 11headers { 12 Content-Type: application/json 13} 14 15body:json { 16 { 17 "topicId": "123456", 18 "reason": "Thread has become off-topic" 19 } 20} 21 22assert { 23 res.status: eq 200 24 res.body.success: eq true 25 res.body.action: eq space.atbb.modAction.lock 26} 27 28docs { 29 Locks a topic to prevent new replies (moderator action). 30 31 Requires authentication via session cookie and `space.atbb.permission.lockTopics` permission. 32 33 Body parameters: 34 - topicId: string (required) - Database ID of the topic post to lock (must be numeric) 35 - reason: string (required) - Reason for locking (1-3000 characters, cannot be empty) 36 37 Returns: 38 { 39 "success": true, 40 "action": "space.atbb.modAction.lock", 41 "topicId": "123456", 42 "postUri": "at://user-did/space.atbb.post/rkey", 43 "uri": "at://forum-did/space.atbb.modAction/rkey", 44 "cid": "bafyrei...", 45 "alreadyActive": false 46 } 47 48 If topic is already locked, returns 200 with `alreadyActive: true` (idempotent). 49 50 Writes a modAction record to the Forum DID's PDS with: 51 - action: "space.atbb.modAction.lock" 52 - subject: { post: { uri, cid } } 53 - reason: provided reason 54 - createdBy: moderator's DID 55 56 Error codes: 57 - 400: Invalid input (missing/invalid topicId, missing/empty reason, malformed JSON, post is a reply not a topic) 58 - 401: Unauthorized (not authenticated) 59 - 403: Forbidden (lacks lockTopics permission) 60 - 404: Post not found 61 - 500: ForumAgent not available (server configuration issue) 62 - 503: ForumAgent not authenticated or unable to reach Forum PDS (retry later) 63 64 Notes: 65 - Only works on topic posts (root posts), not replies 66 - Returns 400 if post is a reply (rootPostId !== null) 67 - Locks are additive - unlock writes a new reversal action 68}