@peopl-health/nexus 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,9 @@ class TwilioMessageAdapter extends MessageAdapter {
|
|
|
8
8
|
async normalize(rawMessage) {
|
|
9
9
|
const from = rawMessage.From || '';
|
|
10
10
|
const interactive = this._extractInteractive(rawMessage);
|
|
11
|
-
const
|
|
11
|
+
const media = await this._resolveMedia(rawMessage);
|
|
12
|
+
const hasMedia = parseInt(rawMessage.NumMedia || '0', 10) > 0;
|
|
13
|
+
const body = rawMessage.Body || this._extractInteractionText(interactive) || (hasMedia ? `[Media:${media?.mediaType || 'attachment'}]` : '');
|
|
12
14
|
|
|
13
15
|
return {
|
|
14
16
|
messageId: rawMessage.MessageSid || null,
|
|
@@ -20,7 +22,7 @@ class TwilioMessageAdapter extends MessageAdapter {
|
|
|
20
22
|
pushName: rawMessage.ProfileName || null,
|
|
21
23
|
timestamp: Date.now(),
|
|
22
24
|
body,
|
|
23
|
-
media
|
|
25
|
+
media,
|
|
24
26
|
interactive,
|
|
25
27
|
quotedMessageId: rawMessage.OriginalRepliedMessageSid || null,
|
|
26
28
|
raw: rawMessage
|