Live video on the AT Protocol
1package spxrpc
2
3import (
4 "context"
5
6 comatprototypes "github.com/bluesky-social/indigo/api/atproto"
7 "github.com/streamplace/oatproxy/pkg/oatproxy"
8)
9
10func (s *Server) handleComAtprotoIdentityResolveHandle(ctx context.Context, handle string) (*comatprototypes.IdentityResolveHandle_Output, error) {
11 did, err := oatproxy.ResolveHandle(ctx, handle)
12 if err != nil {
13 return nil, err
14 }
15 return &comatprototypes.IdentityResolveHandle_Output{Did: did}, nil
16}
17
18func (s *Server) handleComAtprotoIdentityRefreshIdentity(ctx context.Context, body *comatprototypes.IdentityRefreshIdentity_Input) (*comatprototypes.IdentityDefs_IdentityInfo, error) {
19 ident, err := s.ATSync.RefreshIdentity(ctx, body.Identifier)
20 if err != nil {
21 return nil, err
22 }
23 return &comatprototypes.IdentityDefs_IdentityInfo{
24 Did: ident.DID.String(),
25 Handle: ident.Handle.String(),
26 DidDoc: ident.DIDDocument(),
27 }, nil
28}