this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

auto detect correct pds for 'home' server in compare repos (#435)

calling getRepo against bsky.social for an account thats been migrated
no longer works, so this makes the command "do what i mean" more

authored by

Whyrusleeping and committed by
GitHub
76185bf9 536f1dfa

+18 -2
+18 -2
cmd/gosky/debug.go
··· 18 18 "github.com/bluesky-social/indigo/api/atproto" 19 19 comatproto "github.com/bluesky-social/indigo/api/atproto" 20 20 "github.com/bluesky-social/indigo/api/bsky" 21 + "github.com/bluesky-social/indigo/atproto/identity" 22 + "github.com/bluesky-social/indigo/atproto/syntax" 21 23 "github.com/bluesky-social/indigo/did" 22 24 "github.com/bluesky-social/indigo/events" 23 25 "github.com/bluesky-social/indigo/events/schedulers/sequential" ··· 834 836 ArgsUsage: `<did>`, 835 837 Action: func(cctx *cli.Context) error { 836 838 ctx := cctx.Context 839 + did, err := syntax.ParseAtIdentifier(cctx.Args().First()) 840 + if err != nil { 841 + return err 842 + } 837 843 838 844 wg := sync.WaitGroup{} 839 845 wg.Add(2) ··· 845 851 }, 846 852 } 847 853 854 + if !cctx.IsSet("host-1") { 855 + dir := identity.DefaultDirectory() 856 + ident, err := dir.Lookup(ctx, *did) 857 + if err != nil { 858 + return err 859 + } 860 + 861 + xrpc1.Host = ident.PDSEndpoint() 862 + } 863 + 848 864 xrpc2 := xrpc.Client{ 849 865 Host: cctx.String("host-2"), 850 866 Client: &http.Client{ ··· 856 872 go func() { 857 873 defer wg.Done() 858 874 logger := log.With("host", cctx.String("host-1")) 859 - repo1bytes, err := comatproto.SyncGetRepo(ctx, &xrpc1, cctx.Args().First(), "") 875 + repo1bytes, err := comatproto.SyncGetRepo(ctx, &xrpc1, did.String(), "") 860 876 if err != nil { 861 877 logger.Fatalf("getting repo: %s", err) 862 878 return ··· 873 889 go func() { 874 890 defer wg.Done() 875 891 logger := log.With("host", cctx.String("host-2")) 876 - repo2bytes, err := comatproto.SyncGetRepo(ctx, &xrpc2, cctx.Args().First(), "") 892 + repo2bytes, err := comatproto.SyncGetRepo(ctx, &xrpc2, did.String(), "") 877 893 if err != nil { 878 894 logger.Fatalf("getting repo: %s", err) 879 895 return