Skip to content

Commit

Permalink
Add room description to Linear issue if available
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelbartolome committed Sep 10, 2024
1 parent 45e41fd commit 3309e37
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 @@ -989,12 +989,15 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis

var dataKeys, eventDataKeys []string
var eventSource string
var roomDescription string
for k := range p.Data {
switch k {
case "event_id", "room_id", "event_timestamp":
eventDataKeys = append(eventDataKeys, k)
case "decrypted_event_source":
eventSource = p.Data[k]
case "room_description":
roomDescription = p.Data[k]
default:
dataKeys = append(dataKeys, k)
}
Expand All @@ -1006,6 +1009,9 @@ func (s *submitServer) buildReportBody(ctx context.Context, p parsedPayload, lis
if eventSource != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Event source:\n\n```json\n%s\n```\n", eventSource)
}
if roomDescription != "" {
_, _ = fmt.Fprintf(&bodyBuf, "### Room description:\n\n```json\n%s\n```\n", roomDescription)
}
printDataKeys(p, &bodyBuf, "Data from app", dataKeys)

return &bodyBuf
Expand Down

0 comments on commit 3309e37

Please sign in to comment.