mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-19 15:44:28 +01:00
@@ -31,6 +31,7 @@ type GroupEntry struct {
|
||||
|
||||
type RegisterNumberRequest struct {
|
||||
UseVoice bool `json:"use_voice"`
|
||||
Captcha string `json:"captcha"`
|
||||
}
|
||||
|
||||
type VerifyNumberSettings struct {
|
||||
@@ -328,6 +329,7 @@ func (a *Api) RegisterNumber(c *gin.Context) {
|
||||
}
|
||||
} else {
|
||||
req.UseVoice = false
|
||||
req.Captcha = ""
|
||||
}
|
||||
|
||||
if number == "" {
|
||||
@@ -341,6 +343,10 @@ func (a *Api) RegisterNumber(c *gin.Context) {
|
||||
command = append(command, "--voice")
|
||||
}
|
||||
|
||||
if req.Captcha != "" {
|
||||
command = append(command, []string{"--captcha", req.Captcha}...)
|
||||
}
|
||||
|
||||
_, err := runSignalCli(true, command, "")
|
||||
if err != nil {
|
||||
c.JSON(400, gin.H{"error": err.Error()})
|
||||
|
||||
Reference in New Issue
Block a user