Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type Config struct {
LogType string
WebhookFiles bool
ConnectOnStartup bool
RerequestFromPhone bool
OsName string
AmqpUrl string
AmqpGlobalEnabled bool
Expand Down Expand Up @@ -280,6 +281,8 @@ func Load() *Config {
checkUserExists = "true"
}

rerequestFromPhone := os.Getenv(config_env.REREQUEST_FROM_PHONE)

// Convertendo para int com valores padrão caso estejam vazios
major := 0
if whatsappVersionMajor != "" {
Expand Down Expand Up @@ -375,6 +378,7 @@ func Load() *Config {
EventIgnoreStatus: eventIgnoreStatus == "true",
QrcodeMaxCount: qrMaxCount,
CheckUserExists: checkUserExists != "false", // Default true, set to false to disable
RerequestFromPhone: rerequestFromPhone == "true",
AmqpGlobalEvents: amqpGlobalEvents,
AmqpSpecificEvents: amqpSpecificEvents,
NatsUrl: natsUrl,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
LOGTYPE = "LOG_TYPE"
WEBHOOKFILES = "WEBHOOK_FILES"
CONNECT_ON_STARTUP = "CONNECT_ON_STARTUP"
REREQUEST_FROM_PHONE = "REREQUEST_FROM_PHONE"
OS_NAME = "OS_NAME"
AMQP_URL = "AMQP_URL"
AMQP_GLOBAL_ENABLED = "AMQP_GLOBAL_ENABLED"
Expand Down
2 changes: 2 additions & 0 deletions pkg/whatsmeow/service/whatsmeow.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ func (w whatsmeowService) StartClient(cd *ClientData) {

client.EnableAutoReconnect = false
client.AutoTrustIdentity = true
// Re-request messages that fail to decrypt from the phone instead of dropping them.
client.AutomaticMessageRerequestFromPhone = w.config.RerequestFromPhone

mycli := &MyClient{
service: &w,
Expand Down