fix(whatsapp): remove janela de 24h pra providers Web (wuzapi, evolution)
A regra de 24h é da Meta Cloud API. Providers que conectam via WhatsApp Web (baileys, zapi — já isentos; wuzapi, evolution — agora isentos) permitem mensagem livre a qualquer momento. Antes: agente via "Você só pode responder a esta conversa usando um modelo de mensagem devido a Restrições de janela de mensagem de 24 horas" e ficava bloqueado de digitar. Agora: MessageWindowService.messaging_window retorna nil pros 4 providers Web, o que faz can_reply? retornar true incondicionalmente. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4b0e8c314e
commit
d1fa5335e1
@ -14,7 +14,7 @@ class Conversations::MessageWindowService
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def messaging_window # rubocop:disable Metrics/CyclomaticComplexity
|
def messaging_window
|
||||||
case @conversation.inbox.channel_type
|
case @conversation.inbox.channel_type
|
||||||
when 'Channel::Api'
|
when 'Channel::Api'
|
||||||
api_messaging_window
|
api_messaging_window
|
||||||
@ -25,7 +25,10 @@ class Conversations::MessageWindowService
|
|||||||
when 'Channel::Tiktok'
|
when 'Channel::Tiktok'
|
||||||
tiktok_messaging_window
|
tiktok_messaging_window
|
||||||
when 'Channel::Whatsapp'
|
when 'Channel::Whatsapp'
|
||||||
return if %w[baileys zapi].include?(@conversation.inbox.channel.provider)
|
# Providers via WhatsApp Web (baileys, zapi, wuzapi, evolution) não
|
||||||
|
# estão sujeitos à janela de 24h da Meta Cloud API — Web permite
|
||||||
|
# mensagem livre a qualquer momento.
|
||||||
|
return if %w[baileys zapi wuzapi evolution].include?(@conversation.inbox.channel.provider)
|
||||||
|
|
||||||
MESSAGING_WINDOW_24_HOURS
|
MESSAGING_WINDOW_24_HOURS
|
||||||
when 'Channel::TwilioSms'
|
when 'Channel::TwilioSms'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user