mirror of
https://github.com/pushbits/server.git
synced 2025-04-29 18:26:49 +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/fzipp/gocyclo/cmd/gocyclo@latest
|
||||||
go install github.com/securego/gosec/v2/cmd/gosec@latest
|
go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||||
go install github.com/swaggo/swag/cmd/swag@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
|
poetry install
|
||||||
|
|
||||||
.PHONY: swag
|
.PHONY: swag
|
||||||
|
|
|
@ -31,9 +31,9 @@ type MessageEvent struct {
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
FormattedBody string `json:"formatted_body"`
|
FormattedBody string `json:"formatted_body"`
|
||||||
MsgType MsgType `json:"msgtype"`
|
MsgType MsgType `json:"msgtype"`
|
||||||
RelatesTo RelatesTo `json:"m.relates_to,omitempty"`
|
RelatesTo *RelatesTo `json:"m.relates_to,omitempty"`
|
||||||
Format MessageFormat `json:"format"`
|
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
|
// RelatesTo holds information about relations to other message events
|
||||||
|
@ -212,8 +212,8 @@ func (d *Dispatcher) replaceMessage(a *model.Application, newBody, newFormattedB
|
||||||
Body: oldBody,
|
Body: oldBody,
|
||||||
FormattedBody: oldFormattedBody,
|
FormattedBody: oldFormattedBody,
|
||||||
MsgType: MsgTypeText,
|
MsgType: MsgTypeText,
|
||||||
NewContent: newMessage,
|
NewContent: &newMessage,
|
||||||
RelatesTo: replaceRelation,
|
RelatesTo: &replaceRelation,
|
||||||
Format: MessageFormatHTML,
|
Format: MessageFormatHTML,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ func (d *Dispatcher) respondToMessage(a *model.Application, body, formattedBody
|
||||||
notificationRelation := RelatesTo{
|
notificationRelation := RelatesTo{
|
||||||
InReplyTo: notificationReply,
|
InReplyTo: notificationReply,
|
||||||
}
|
}
|
||||||
notificationEvent.RelatesTo = notificationRelation
|
notificationEvent.RelatesTo = ¬ificationRelation
|
||||||
|
|
||||||
return d.mautrixClient.SendMessageEvent(mId.RoomID(a.MatrixID), event.EventMessage, ¬ificationEvent)
|
return d.mautrixClient.SendMessageEvent(mId.RoomID(a.MatrixID), event.EventMessage, ¬ificationEvent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue