Skip to content

Commit

Permalink
Fix: elevate !no-unauthenticated label to affect the entire account w…
Browse files Browse the repository at this point in the history
…hen on the profile (#1966)

* Fix: elevate !no-unauthenticated label to affect the entire account when on the profile

* lint

* Add changeset

---------

Co-authored-by: dholms <[email protected]>
  • Loading branch information
pfrazee and dholms authored Dec 14, 2023
1 parent 8d4a87c commit 8f3f43c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-ducks-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@atproto/api': patch
---

Fix to the application of the no-unauthenticated label
6 changes: 6 additions & 0 deletions packages/api/definitions/post-moderation-behaviors.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,12 @@
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {
"content": {
"cause": "label:!no-unauthenticated",
"filter": true,
"blur": true,
"noOverride": true
},
"avatar": {
"cause": "label:!no-unauthenticated",
"blur": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/api/definitions/profile-moderation-behaviors.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@
"author": "alice",
"labels": { "profile": ["!no-unauthenticated"] },
"behaviors": {
"account": {
"cause": "label:!no-unauthenticated",
"filter": true,
"blur": true,
"noOverride": true
},
"profile": {
"cause": "label:!no-unauthenticated",
"blur": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/api/docs/moderation-behaviors/posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ Key:
<tr>
<td><strong>Imperative label ('!no-unauthenticated') on author profile when logged out</strong></td>
<td>

</td>
<td>

🚫
</td>
<td>
🚫
Expand Down
3 changes: 2 additions & 1 deletion packages/api/docs/moderation-behaviors/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ Key:
<tr>
<td><strong>Imperative label ('!no-unauthenticated') on profile when logged out</strong></td>
<td>

</td>
<td>
🚫

</td>
<td>
Expand Down
4 changes: 3 additions & 1 deletion packages/api/src/moderation/subjects/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export function filterAccountLabels(labels?: Label[]): Label[] {
return []
}
return labels.filter(
(label) => !label.uri.endsWith('/app.bsky.actor.profile/self'),
(label) =>
!label.uri.endsWith('/app.bsky.actor.profile/self') ||
label.val === '!no-unauthenticated',
)
}

0 comments on commit 8f3f43c

Please sign in to comment.