this repo has no description
0
fork

Configure Feed

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

add commands for deleting accounts (#371)

authored by

Whyrusleeping and committed by
GitHub
ed37b5c1 4bbcf541

+45 -2
+2 -1
cmd/gosky/admin.go
··· 103 103 } else { 104 104 handle, _, err := api.ResolveDidToHandle(ctx, xrpcc, plcc, phr, fa) 105 105 if err != nil { 106 - return fmt.Errorf("resolve did %q: %w", fa, err) 106 + fmt.Println("ERROR: failed to resolve inviter: ", err) 107 + handle = fa 107 108 } 108 109 109 110 invby = handle
+43 -1
cmd/gosky/main.go
··· 94 94 refreshAuthTokenCmd, 95 95 syncCmd, 96 96 listAllPostsCmd, 97 - deletePostCmd, 98 97 getNotificationsCmd, 99 98 followsCmd, 100 99 resetPasswordCmd, ··· 105 104 adminCmd, 106 105 createFeedGeneratorCmd, 107 106 rebaseRepoCmd, 107 + requestAccountDeletionCmd, 108 + deleteAccountCmd, 108 109 } 109 110 110 111 app.RunAndExitOnError() ··· 1566 1567 return nil 1567 1568 }, 1568 1569 } 1570 + 1571 + var requestAccountDeletionCmd = &cli.Command{ 1572 + Name: "request-account-deletion", 1573 + Action: func(cctx *cli.Context) error { 1574 + xrpcc, err := cliutil.GetXrpcClient(cctx, false) 1575 + if err != nil { 1576 + return err 1577 + } 1578 + 1579 + err = comatproto.ServerRequestAccountDelete(cctx.Context, xrpcc) 1580 + if err != nil { 1581 + return err 1582 + } 1583 + 1584 + return nil 1585 + }, 1586 + } 1587 + 1588 + var deleteAccountCmd = &cli.Command{ 1589 + Name: "delete-account", 1590 + Action: func(cctx *cli.Context) error { 1591 + xrpcc, err := cliutil.GetXrpcClient(cctx, false) 1592 + if err != nil { 1593 + return err 1594 + } 1595 + 1596 + token := cctx.Args().First() 1597 + password := cctx.Args().Get(1) 1598 + 1599 + err = comatproto.ServerDeleteAccount(cctx.Context, xrpcc, &comatproto.ServerDeleteAccount_Input{ 1600 + Did: xrpcc.Auth.Did, 1601 + Token: token, 1602 + Password: password, 1603 + }) 1604 + if err != nil { 1605 + return err 1606 + } 1607 + 1608 + return nil 1609 + }, 1610 + }