Browse Source
Implemented proper handling of newline characters in message
pull/61/head
Z
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
internal/whatsapp/whatsapp.go
|
|
|
@ -274,7 +274,8 @@ func SendText(c echo.Context) error { |
|
|
|
|
|
|
|
var reqSendMessage typWhatsApp.RequestSendMessage |
|
|
|
reqSendMessage.RJID = strings.TrimSpace(c.FormValue("msisdn")) |
|
|
|
reqSendMessage.Message = strings.TrimSpace(c.FormValue("message")) |
|
|
|
message := strings.TrimSpace(c.FormValue("message")) |
|
|
|
reqSendMessage.Message = strings.Replace(message, "\\n", "\n", -1) |
|
|
|
|
|
|
|
if len(reqSendMessage.RJID) == 0 { |
|
|
|
return router.ResponseBadRequest(c, "Missing Form Value MSISDN") |
|
|
|
|