Fallback bridge replies by phone
This commit is contained in:
@@ -119,8 +119,8 @@ public final class ExternalBridgeHandler implements HttpHandler {
|
||||
}
|
||||
try (Connection c = masterDs.getMasterConnection()) {
|
||||
Map<String,Object> envio = one(c, "SELECT * FROM integracao_mensagens WHERE telefone=? AND callback_url IS NOT NULL AND status='enviado' ORDER BY criado_em DESC,id DESC LIMIT 1", numero);
|
||||
if (envio == null && raw.contains("@lid")) {
|
||||
envio = one(c, "SELECT * FROM integracao_mensagens WHERE callback_url IS NOT NULL AND status='enviado' AND criado_em >= now() - interval '24 hours' ORDER BY criado_em DESC,id DESC LIMIT 1");
|
||||
if (envio == null) {
|
||||
envio = one(c, "SELECT * FROM integracao_mensagens WHERE telefone=? AND callback_url IS NOT NULL AND criado_em >= now() - interval '24 hours' ORDER BY criado_em DESC,id DESC LIMIT 1", numero);
|
||||
}
|
||||
if (envio == null) {
|
||||
System.out.println("Webhook Evolution sem envio correspondente. numero=" + numero + ", texto=" + resumo(texto));
|
||||
|
||||
Reference in New Issue
Block a user