mirror of
https://github.com/pushbits/server.git
synced 2025-04-28 17:56:50 +02:00
Merge pull request #50 from pushbits/#49-empty-notification
#49 Fix empty notifications
This commit is contained in:
commit
6d6c19de30
2 changed files with 6 additions and 6 deletions
2
Makefile
2
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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue