aboutsummaryrefslogtreecommitdiff
path: root/backend/notes
diff options
context:
space:
mode:
Diffstat (limited to 'backend/notes')
-rw-r--r--backend/notes/app.bsky.actor.go7
-rw-r--r--backend/notes/author.go1
-rw-r--r--backend/notes/note.go5
3 files changed, 5 insertions, 8 deletions
diff --git a/backend/notes/app.bsky.actor.go b/backend/notes/app.bsky.actor.go
index 797a8e8..00a1ff1 100644
--- a/backend/notes/app.bsky.actor.go
+++ b/backend/notes/app.bsky.actor.go
@@ -25,13 +25,13 @@ type AppBskyActorProfileRecord struct {
} `json:"labels,omitempty"`
}
-func AuthorFromAppBskyActorProfileRecord(record AppBskyActorProfileRecord, did, handle string) (*Author, error) {
+func AuthorFromAppBskyActorProfileRecord(record AppBskyActorProfileRecord, did, handle, pds string) (*Author, error) {
var avatarURL, bannerURL string
if record.Avatar != nil {
- avatarURL = fmt.Sprintf("https://cdn.bsky.app/img/avatar/plain/%s/%s@jpeg", did, record.Avatar.Ref.Link)
+ avatarURL = fmt.Sprintf("%s/xrpc/com.atproto.sync.getBlob?did=%s&cid=%s", pds, did, record.Avatar.Ref.Link)
}
if record.Banner != nil {
- bannerURL = fmt.Sprintf("https://cdn.bsky.app/img/banner/plain/%s/%s@jpeg", did, record.Banner.Ref.Link)
+ bannerURL = fmt.Sprintf("%s/xrpc/com.atproto.sync.getBlob?did=%s&cid=%s", pds, did, record.Banner.Ref.Link)
}
// check for !no-unauthenticated label
@@ -45,6 +45,7 @@ func AuthorFromAppBskyActorProfileRecord(record AppBskyActorProfileRecord, did,
}
author := &Author{
+ PDS: pds,
Handle: handle,
DisplayName: record.DisplayName,
AvatarURL: avatarURL,
diff --git a/backend/notes/author.go b/backend/notes/author.go
index 644a10c..faf4f7b 100644
--- a/backend/notes/author.go
+++ b/backend/notes/author.go
@@ -1,6 +1,7 @@
package notes
type Author struct {
+ PDS string
Handle string
DisplayName string
AvatarURL string
diff --git a/backend/notes/note.go b/backend/notes/note.go
index 7ef537f..72c885d 100644
--- a/backend/notes/note.go
+++ b/backend/notes/note.go
@@ -1,7 +1,6 @@
package notes
import (
- "sort"
"time"
)
@@ -54,10 +53,6 @@ func isChainContained(smallChainPost, bigChainPost Note) bool {
}
func DeduplicateThreads(posts []Note) []Note {
- sort.Slice(posts, func(i, j int) bool {
- return len(posts[i].Parents) > len(posts[j].Parents)
- })
-
filtered := []Note{}
for _, post := range posts {
isRedundant := false