Skip to content

Commit

Permalink
Parse message blocks in attachments too
Browse files Browse the repository at this point in the history
  • Loading branch information
twouters committed Oct 10, 2023
1 parent 03070e8 commit 801e70c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ func (portal *Portal) SlackBlocksToMatrix(blocks slack.Blocks, attachments []sla
htmlText.WriteString(fmt.Sprintf("<blockquote><b>%s</b><br>%s<a href=\"%s\"><i>%s</i></a><br></blockquote>",
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("<blockquote>%s</blockquote>", renderedAttachment))
}
} else {
if len(attachment.Pretext) > 0 {
htmlText.WriteString(fmt.Sprintf("%s<br>", portal.mrkdwnToMatrixHtml(attachment.Pretext)))
Expand Down

0 comments on commit 801e70c

Please sign in to comment.