diff options
| author | Guillermo Serrahima <dev@vylion.com> | 2026-03-20 00:54:07 +0100 |
|---|---|---|
| committer | Guillermo Serrahima <dev@vylion.com> | 2026-03-20 00:54:07 +0100 |
| commit | 1d947b771995399b677c040136ef2cf88b33d4f2 (patch) | |
| tree | 3cdd673f6c27c9a5a481627895d1fee932b85580 /backend/notes/app.bsky.actor.go | |
| parent | 59545c874d8635c39ccdbecf84f953686dd5c03c (diff) | |
| download | llostre-1d947b771995399b677c040136ef2cf88b33d4f2.tar.xz llostre-1d947b771995399b677c040136ef2cf88b33d4f2.zip | |
readded auth that I removed in my hubris + check for no-unauthorized labels
Diffstat (limited to 'backend/notes/app.bsky.actor.go')
| -rw-r--r-- | backend/notes/app.bsky.actor.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/notes/app.bsky.actor.go b/backend/notes/app.bsky.actor.go index dc5d536..797a8e8 100644 --- a/backend/notes/app.bsky.actor.go +++ b/backend/notes/app.bsky.actor.go @@ -17,6 +17,12 @@ type AppBskyActorProfileRecord struct { } `json:"ref"` } `json:"banner,omitempty"` Pronouns string `json:"pronouns"` + Labels *struct { + Type string `json:"$type"` + Values []struct { + Val string `json:"val"` + } `json:"values"` + } `json:"labels,omitempty"` } func AuthorFromAppBskyActorProfileRecord(record AppBskyActorProfileRecord, did, handle string) (*Author, error) { @@ -28,12 +34,23 @@ func AuthorFromAppBskyActorProfileRecord(record AppBskyActorProfileRecord, did, bannerURL = fmt.Sprintf("https://cdn.bsky.app/img/banner/plain/%s/%s@jpeg", did, record.Banner.Ref.Link) } + // check for !no-unauthenticated label + noUnauth := false + if record.Labels != nil && record.Labels.Type == "com.atproto.label.defs#selfLabels" { + for _, label := range record.Labels.Values { + if label.Val == "!no-unauthenticated" { + noUnauth = true + } + } + } + author := &Author{ Handle: handle, DisplayName: record.DisplayName, AvatarURL: avatarURL, BannerURL: bannerURL, Pronouns: record.Pronouns, + NoUnauth: noUnauth, } return author, nil |
