From 73bb35e35c25bca2b5626691148a958a5401e69e Mon Sep 17 00:00:00 2001 From: Hailey Date: Mon, 4 Nov 2024 17:27:52 -0800 Subject: [PATCH] update --- automod/engine/cid_from_cdn_test.go | 2 +- automod/engine/fetch_account_meta.go | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/automod/engine/cid_from_cdn_test.go b/automod/engine/cid_from_cdn_test.go index cc7553cb..0780403c 100644 --- a/automod/engine/cid_from_cdn_test.go +++ b/automod/engine/cid_from_cdn_test.go @@ -37,6 +37,6 @@ func TestCidFromCdnUrl(t *testing.T) { } for _, fix := range fixtures { - assert.Equal(fix.cid, CidFromCdnUrl(&fix.url)) + assert.Equal(fix.cid, cidFromCdnUrl(&fix.url)) } } diff --git a/automod/engine/fetch_account_meta.go b/automod/engine/fetch_account_meta.go index b634c856..2b51930c 100644 --- a/automod/engine/fetch_account_meta.go +++ b/automod/engine/fetch_account_meta.go @@ -5,8 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "net/url" - "strings" "time" comatproto "github.com/bluesky-social/indigo/api/atproto" @@ -19,25 +17,6 @@ import ( var newAccountRetryDuration = 3 * 1000 * time.Millisecond -// get the cid from a bluesky cdn url -func CidFromCdnUrl(str *string) *string { - if str == nil { - return nil - } - - u, err := url.Parse(*str) - if err != nil || u.Host != "cdn.bsky.app" { - return nil - } - - parts := strings.Split(u.Path, "/") - if len(parts) != 6 { - return nil - } - - return &strings.Split(parts[5], "@")[0] -} - // Helper to hydrate metadata about an account from several sources: PDS (if access), mod service (if access), public identity resolution func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) (*AccountMeta, error) { -- 2.51.2