Skip to content

Commit

Permalink
make disableInvites actually disable existing invites as well (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping authored Sep 8, 2023
2 parents 2fcb59a + 1a69665 commit f934d62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func (dr *ProdHandleResolver) resolveWellKnown(ctx context.Context, handle strin
}

func (dr *ProdHandleResolver) resolveDNS(ctx context.Context, handle string) (string, error) {

res, err := net.LookupTXT("_atproto." + handle)
if err != nil {
return "", fmt.Errorf("handle lookup failed: %w", err)
Expand Down
14 changes: 12 additions & 2 deletions cmd/gosky/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,19 @@ var disableInvitesCmd = &cli.Command{
handle = resp
}

return atproto.AdminDisableAccountInvites(ctx, xrpcc, &atproto.AdminDisableAccountInvites_Input{
if err := atproto.AdminDisableAccountInvites(ctx, xrpcc, &atproto.AdminDisableAccountInvites_Input{
Account: handle,
})
}); err != nil {
return err
}

if err := atproto.AdminDisableInviteCodes(ctx, xrpcc, &atproto.AdminDisableInviteCodes_Input{
Accounts: []string{handle},
}); err != nil {
return err
}

return nil
},
}

Expand Down

0 comments on commit f934d62

Please sign in to comment.