From 84e9fd4b0cb712102d3e0d0ec0360d40b8e4fc2a Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Tue, 10 Oct 2023 10:09:46 +0200 Subject: [PATCH] Parse message blocks in attachments too --- blocks.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blocks.go b/blocks.go index c3aa2f9..80374ae 100644 --- a/blocks.go +++ b/blocks.go @@ -278,6 +278,11 @@ func (portal *Portal) SlackBlocksToMatrix(blocks slack.Blocks, attachments []sla htmlText.WriteString(fmt.Sprintf("
%s
%s%s
", attachment.AuthorName, renderedAttachment, attachment.FromURL, attachment.Footer)) } + } else if len(attachment.MessageBlocks) > 0 { + for _, message_block := range attachment.MessageBlocks { + renderedAttachment := portal.blocksToHtml(message_block.Message.Blocks, true, userTeam) + htmlText.WriteString(fmt.Sprintf("
%s
", renderedAttachment)) + } } else { if len(attachment.Pretext) > 0 { htmlText.WriteString(fmt.Sprintf("%s
", portal.mrkdwnToMatrixHtml(attachment.Pretext)))