diff --git a/Makefile b/Makefile index 520967c..5b3a535 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ setup: go install github.com/fzipp/gocyclo/cmd/gocyclo@latest go install github.com/securego/gosec/v2/cmd/gosec@latest go install github.com/swaggo/swag/cmd/swag@latest - go install honnef.co/go/tools/cmd/staticcheck@latest + go install honnef.co/go/tools/cmd/staticcheck@v0.2.2 poetry install .PHONY: swag diff --git a/internal/dispatcher/notification.go b/internal/dispatcher/notification.go index b23bca6..574c995 100644 --- a/internal/dispatcher/notification.go +++ b/internal/dispatcher/notification.go @@ -31,9 +31,9 @@ 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"` + NewContent *NewContent `json:"m.new_content,omitempty"` } // RelatesTo holds information about relations to other message events @@ -212,8 +212,8 @@ func (d *Dispatcher) replaceMessage(a *model.Application, newBody, newFormattedB Body: oldBody, FormattedBody: oldFormattedBody, MsgType: MsgTypeText, - NewContent: newMessage, - RelatesTo: replaceRelation, + NewContent: &newMessage, + 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) }