this repo has no description
0
fork

Configure Feed

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

fetch profile and use proper display name in record

+24 -4
+24 -4
cmd/gosky/main.go
··· 827 827 } 828 828 829 829 ctx := context.TODO() 830 - handle := cctx.Args().First() 830 + arg := cctx.Args().First() 831 831 832 - ident, err := identity.DefaultDirectory().LookupHandle(ctx, syntax.Handle(handle)) 832 + idf, err := syntax.ParseAtIdentifier(arg) 833 + if err != nil { 834 + return err 835 + } 836 + 837 + ident, err := identity.DefaultDirectory().Lookup(ctx, *idf) 838 + if err != nil { 839 + return err 840 + } 841 + 842 + profrec, err := atproto.RepoGetRecord(ctx, xrpcc, "", "app.bsky.actor.profile", ident.DID.String(), "self") 833 843 if err != nil { 834 844 return err 835 845 } 836 846 847 + ap, ok := profrec.Value.Val.(*bsky.ActorProfile) 848 + if !ok { 849 + return fmt.Errorf("got wrong record type back") 850 + } 851 + 852 + var dn string 853 + if ap.DisplayName != nil { 854 + dn = *ap.DisplayName 855 + } 856 + 837 857 rec := &lexutil.LexiconTypeDecoder{Val: &bsky.GraphVerification{ 838 858 CreatedAt: time.Now().Format(util.ISO8601), 839 - DisplayName: "", 840 - Handle: handle, 859 + DisplayName: dn, 860 + Handle: ident.Handle.String(), 841 861 Subject: ident.DID.String(), 842 862 }} 843 863