Skip to content

Commit

Permalink
Fix handling edits with no extra content
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 2, 2024
1 parent a0fbdee commit 470f59d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions portal.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,8 +1272,10 @@ func (portal *Portal) handleSignalEditMessage(sender *Puppet, timestamp uint64,
}
for i, part := range converted.Parts {
part.Content.SetEdit(targetMessage[i].MXID)
part.Extra = map[string]any{
"m.new_content": part.Extra,
if part.Extra != nil {
part.Extra = map[string]any{
"m.new_content": part.Extra,
}
}
_, err = portal.sendMatrixEvent(intent, part.Type, part.Content, part.Extra, int64(converted.Timestamp))
if err != nil {
Expand Down

0 comments on commit 470f59d

Please sign in to comment.