From 0ad7c3c9f05ea36036ed8022d823cc457179c60a Mon Sep 17 00:00:00 2001 From: David Vitor Antonio Date: Wed, 27 Mar 2024 16:54:52 -0300 Subject: [PATCH] feat(teams): add support for quotes (#663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Levasseur --- packages/channels/src/teams/api.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/channels/src/teams/api.ts b/packages/channels/src/teams/api.ts index 9fe92f642..520533f05 100644 --- a/packages/channels/src/teams/api.ts +++ b/packages/channels/src/teams/api.ts @@ -35,8 +35,14 @@ export class TeamsApi extends ChannelApi { const endpoint = { identity: '*', sender: activity.from.id, thread: convoRef.conversation!.id } const text: string | undefined = activity.value?.text || activity.text + const quote = activity?.attachments?.find((attachment) => attachment?.content?.includes(''))?.content + if (activity?.attachments?.length) { for (const attachment of activity.attachments) { + if (attachment.contentType === 'text/html' && attachment?.content?.length) { + continue + } + const { contentType, name, contentUrl } = attachment await this.service.receive(scope, endpoint, { type: this.mapMimeTypeToStandardType(contentType), @@ -75,7 +81,7 @@ export class TeamsApi extends ChannelApi { payload: text.replace(POSTBACK_PREFIX, '') }) } else { - await this.service.receive(scope, endpoint, { type: 'text', text }) + await this.service.receive(scope, endpoint, { type: 'text', text, ...(quote && { quote }) }) } }