Skip to content

Commit

Permalink
Adds attachment description if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Lima committed Jan 7, 2025
1 parent 0f7bc7d commit 6ee7d9c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis
var dataKeys, eventDataKeys []string
var eventSource string
var roomDescription string
var attachmentDescription string
var latestReadReceipt string
for k := range p.Data {
switch k {
Expand All @@ -1021,6 +1022,8 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis
eventSource = p.Data[k]
case "room_description":
roomDescription = p.Data[k]
case "attachment_description":
attachmentDescription = p.Data[k]
case "latest_read_receipt":
latestReadReceipt = p.Data[k]
default:
Expand All @@ -1037,6 +1040,9 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis
if roomDescription != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Room description:\n\n```json\n%s\n```\n", roomDescription)
}
if attachmentDescription != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Attachment description:\n\n```json\n%s\n```\n", attachmentDescription)
}
if latestReadReceipt != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Latest read receipt:\n\n```json\n%s\n```\n", latestReadReceipt)
}
Expand Down

0 comments on commit 6ee7d9c

Please sign in to comment.