Skip to content

Commit

Permalink
Show latest read receipt data if available (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
blau2 authored Nov 14, 2024
1 parent b369dcc commit 29e2567
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 latestReadReceipt string
for k := range p.Data {
switch k {
case "event_id", "room_id", "event_timestamp":
Expand All @@ -1020,6 +1021,8 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis
eventSource = p.Data[k]
case "room_description":
roomDescription = p.Data[k]
case "latest_read_receipt":
latestReadReceipt = p.Data[k]
default:
dataKeys = append(dataKeys, k)
}
Expand All @@ -1034,6 +1037,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 latestReadReceipt != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Latest read receipt:\n\n```json\n%s\n```\n", latestReadReceipt)
}
printDataKeys(p, &bodyBuf, "Data from app", dataKeys)

return &bodyBuf
Expand Down

0 comments on commit 29e2567

Please sign in to comment.