this repo has no description
0
fork

Configure Feed

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

fix handle resolution in some cli commands

+12 -11
+6 -6
cmd/gosky/admin.go
··· 623 623 624 624 for _, did := range cctx.Args().Slice() { 625 625 if !strings.HasPrefix(did, "did:") { 626 - phr := &api.ProdHandleResolver{} 627 - resp, err := phr.ResolveHandleToDid(ctx, did) 626 + dir := identity.DefaultDirectory() 627 + resp, err := dir.LookupHandle(ctx, syntax.Handle(did)) 628 628 if err != nil { 629 629 return err 630 630 } 631 631 632 - did = resp 632 + did = resp.DID.String() 633 633 } 634 634 635 635 reason := cctx.String("reason") 636 636 adminUser := cctx.String("admin-user") 637 637 if !strings.HasPrefix(adminUser, "did:") { 638 - phr := &api.ProdHandleResolver{} 639 - resp, err := phr.ResolveHandleToDid(ctx, adminUser) 638 + dir := identity.DefaultDirectory() 639 + resp, err := dir.LookupHandle(ctx, syntax.Handle(adminUser)) 640 640 if err != nil { 641 641 return err 642 642 } 643 643 644 - adminUser = resp 644 + adminUser = resp.DID.String() 645 645 } 646 646 647 647 resp, err := toolsozone.ModerationEmitEvent(ctx, xrpcc, &toolsozone.ModerationEmitEvent_Input{
+6 -5
cmd/gosky/handle.go
··· 4 4 "context" 5 5 "fmt" 6 6 7 - api "github.com/bluesky-social/indigo/api" 8 7 comatproto "github.com/bluesky-social/indigo/api/atproto" 8 + "github.com/bluesky-social/indigo/atproto/identity" 9 + "github.com/bluesky-social/indigo/atproto/syntax" 9 10 "github.com/bluesky-social/indigo/util/cliutil" 10 11 11 12 cli "github.com/urfave/cli/v2" ··· 32 33 } 33 34 handle := args[0] 34 35 35 - phr := &api.ProdHandleResolver{} 36 - out, err := phr.ResolveHandleToDid(ctx, handle) 36 + dir := identity.DefaultDirectory() 37 + resp, err := dir.LookupHandle(ctx, syntax.Handle(handle)) 37 38 if err != nil { 38 - return err 39 + return fmt.Errorf("resolving %q: %w", handle, err) 39 40 } 40 41 41 - fmt.Println(out) 42 + fmt.Println(resp.DID) 42 43 43 44 return nil 44 45 },