Skip to content

Commit

Permalink
fix: update to new QR data received from core
Browse files Browse the repository at this point in the history
no need to generate invite links manually anymore
  • Loading branch information
adbenitez committed Jan 8, 2025
1 parent 1262a8d commit 9b9bf10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions botcli/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func qrForAcc(cli *BotCli, bot *deltachat.Bot, cmd *cobra.Command, args []string
fmt.Println("Scan this QR to verify", addr)
invert, _ := cmd.Flags().GetBool("invert")
printQr(qrdata, invert)
fmt.Println(GenerateInviteLink(qrdata))
fmt.Println(qrdata)
} else {
cli.Logger.Error("account not configured")
}
Expand Down Expand Up @@ -306,7 +306,7 @@ func adminForAcc(cli *BotCli, bot *deltachat.Bot, cmd *cobra.Command, args []str
fmt.Println("Scan this QR to become bot administrator")
invert, _ := cmd.Flags().GetBool("invert")
printQr(qrdata, invert)
fmt.Println(GenerateInviteLink(qrdata))
fmt.Println(qrdata)
}

func listCallback(cli *BotCli, bot *deltachat.Bot, cmd *cobra.Command, args []string) {
Expand Down
6 changes: 0 additions & 6 deletions botcli/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import (
"github.com/mdp/qrterminal/v3"
)

// Generate an invite link (https://i.delta.chat) for the given invitation-QR data
func GenerateInviteLink(qrdata string) string {
fragment := strings.Replace(strings.SplitN(qrdata, ":", 2)[1], "#", "&", 1)
return "https://i.delta.chat/#" + fragment
}

func getDefaultAppDir(appName string) string {
cfgDir, _ := os.UserConfigDir()
return filepath.Join(cfgDir, appName)
Expand Down

0 comments on commit 9b9bf10

Please sign in to comment.