mirror of
https://github.com/pushbits/server.git
synced 2025-04-29 10:16:50 +02:00
omit empty relates to
This commit is contained in:
parent
802794212b
commit
85c4ae071a
1 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ type MessageEvent struct {
|
|||
Body string `json:"body"`
|
||||
FormattedBody string `json:"formatted_body"`
|
||||
MsgType MsgType `json:"msgtype"`
|
||||
RelatesTo RelatesTo `json:"m.relates_to,omitempty"`
|
||||
RelatesTo *RelatesTo `json:"m.relates_to,omitempty"`
|
||||
Format MessageFormat `json:"format"`
|
||||
NewContent *NewContent `json:"m.new_content,omitempty"`
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ func (d *Dispatcher) replaceMessage(a *model.Application, newBody, newFormattedB
|
|||
FormattedBody: oldFormattedBody,
|
||||
MsgType: MsgTypeText,
|
||||
NewContent: &newMessage,
|
||||
RelatesTo: replaceRelation,
|
||||
RelatesTo: &replaceRelation,
|
||||
Format: MessageFormatHTML,
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ func (d *Dispatcher) respondToMessage(a *model.Application, body, formattedBody
|
|||
notificationRelation := RelatesTo{
|
||||
InReplyTo: notificationReply,
|
||||
}
|
||||
notificationEvent.RelatesTo = notificationRelation
|
||||
notificationEvent.RelatesTo = ¬ificationRelation
|
||||
|
||||
return d.mautrixClient.SendMessageEvent(mId.RoomID(a.MatrixID), event.EventMessage, ¬ificationEvent)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue