Skip to content

Commit f711fcc

Browse files
bergpinheirodevlikepro
authored andcommitted
[core] add Chatwoot support for WhatsApp status replies
Detect WhatsApp status replies in incoming messages, append localized status context to Chatwoot content, and attach quoted status media when available while preserving current non-status behavior. closes #1995 - Reply message to WhatsApp Status Context in Chatwoot Messages fixes #1991 - Include WhatsApp Status Context in Chatwoot Messages
1 parent 32e57ca commit f711fcc

26 files changed

Lines changed: 542 additions & 6 deletions

src/apps/chatwoot/consumers/waha/message.any.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
PollMessage,
2727
ListMessage,
2828
ShareContactMessage,
29+
StatusReplyMessage,
2930
TextMessage,
3031
UnsupportedMessage,
3132
AlbumMessage,
@@ -86,6 +87,18 @@ export class MessageAnyHandler extends MessageBaseHandler<WAMessage> {
8687
return msg;
8788
}
8889

90+
converter = new StatusReplyMessage(
91+
this.l,
92+
this.logger,
93+
this.waha,
94+
this.job,
95+
this.session,
96+
);
97+
msg = await converter.convert(payload, protoMessage);
98+
if (msg) {
99+
return msg;
100+
}
101+
89102
converter = new TextMessage(this.l, this.logger, this.waha, this.job);
90103
msg = await converter.convert(payload, null);
91104
if (msg) {

src/apps/chatwoot/i18n/locales/ar-AE.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **تم إرسال PIX نسخ ولصق**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **رد على حالة واتساب**
494+
🏷️ **النوع:** {{type}}
495+
{{#quotedText}}
496+
📝 **نص الحالة:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **هذا النوع من الرسائل غير مدعوم في هذا الصندوق الوارد.**
494503
📱 يرجى فتح **WhatsApp** لعرضه.

src/apps/chatwoot/i18n/locales/bn-BD.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX কপি এবং পেস্ট পাঠানো হয়েছে**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **WhatsApp স্ট্যাটাসের জবাব**
494+
🏷️ **ধরন:** {{type}}
495+
{{#quotedText}}
496+
📝 **স্ট্যাটাসের টেক্সট:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **এই ধরনের বার্তা এই ইনবক্সে সমর্থিত নয়।**
494503
📱 এটি দেখতে অনুগ্রহ করে **WhatsApp** খুলুন।

src/apps/chatwoot/i18n/locales/de-DE.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,15 @@ whatsapp.to.chatwoot.message.pix: |-
492492
💳 **PIX Kopieren und Einfügen gesendet**
493493
{{/pixData}}
494494
495+
whatsapp.to.chatwoot.message.status.reply: |-
496+
📣 **Antwort auf WhatsApp-Status**
497+
🏷️ **Typ:** {{type}}
498+
{{#quotedText}}
499+
📝 **Status-Text:** {{quotedText}}
500+
{{/quotedText}}
501+
502+
{{content}}
503+
495504
whatsapp.to.chatwoot.message.unsupported: |-
496505
⚠️ **Dieser Nachrichtentyp wird in dieser Inbox nicht unterstützt.**
497506
📱 Bitte öffne **WhatsApp**, um ihn anzusehen.

src/apps/chatwoot/i18n/locales/en-US.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,15 @@ whatsapp.to.chatwoot.message.pix: |-
270270
💳 **PIX Copy and Paste sent**
271271
{{/pixData}}
272272
273+
whatsapp.to.chatwoot.message.status.reply: |-
274+
📣 **Reply to WhatsApp Status**
275+
🏷️ **Type:** {{type}}
276+
{{#quotedText}}
277+
📝 **Status Text:** {{quotedText}}
278+
{{/quotedText}}
279+
280+
{{content}}
281+
273282
whatsapp.to.chatwoot.message.has.media.no.media: |-
274283
{{#content}}
275284
{{{content}}}

src/apps/chatwoot/i18n/locales/es-ES.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX Copiar y Pegar enviado**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **Respuesta al estado de WhatsApp**
494+
🏷️ **Tipo:** {{type}}
495+
{{#quotedText}}
496+
📝 **Texto del Estado:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **Este tipo de mensaje no es compatible con esta bandeja de entrada.**
494503
📱 Por favor, abre **WhatsApp** para verlo.

src/apps/chatwoot/i18n/locales/fa-IR.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX کپی و چسباندن ارسال شد**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **پاسخ به وضعیت واتساپ**
494+
🏷️ **نوع:** {{type}}
495+
{{#quotedText}}
496+
📝 **متن وضعیت:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **این نوع پیام در این صندوق ورودی پشتیبانی نمی‌شود.**
494503
📱 لطفاً برای مشاهده آن **WhatsApp** را باز کنید.

src/apps/chatwoot/i18n/locales/fr-FR.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX Copier et Coller envoyé**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **Réponse au statut WhatsApp**
494+
🏷️ **Type :** {{type}}
495+
{{#quotedText}}
496+
📝 **Texte du Statut :** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **Ce type de message n’est pas pris en charge dans cette boîte de réception.**
494503
📱 Veuillez ouvrir **WhatsApp** pour l’afficher.

src/apps/chatwoot/i18n/locales/he-IL.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX העתק והדבק נשלח**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **תגובה לסטטוס ב-WhatsApp**
494+
🏷️ **סוג:** {{type}}
495+
{{#quotedText}}
496+
📝 **טקסט הסטטוס:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **סוג הודעה זה אינו נתמך בתיבה זו.**
494503
📱 אנא פתח/י את **WhatsApp** כדי לצפות בזה.

src/apps/chatwoot/i18n/locales/hi-IN.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,15 @@ whatsapp.to.chatwoot.message.pix: |-
489489
💳 **PIX कॉपी और पेस्ट भेजा गया**
490490
{{/pixData}}
491491
492+
whatsapp.to.chatwoot.message.status.reply: |-
493+
📣 **WhatsApp स्टेटस का जवाब**
494+
🏷️ **प्रकार:** {{type}}
495+
{{#quotedText}}
496+
📝 **स्टेटस टेक्स्ट:** {{quotedText}}
497+
{{/quotedText}}
498+
499+
{{content}}
500+
492501
whatsapp.to.chatwoot.message.unsupported: |-
493502
⚠️ **इस प्रकार का संदेश इस इनबॉक्स में समर्थित नहीं है।**
494503
📱 इसे देखने के लिए कृपया **WhatsApp** खोलें।

0 commit comments

Comments
 (0)