🐛 Fix edit message did not has the related event id

This commit is contained in:
LittleSheep 2024-12-29 23:09:39 +08:00
parent 3d1c7e1bda
commit 3000b9d1a3

View File

@ -21,14 +21,15 @@ func EditMessage(event models.Event, body models.EventMessageBody) (models.Event
}
body.RelatedEventID = &event.ID
_, err = NewEvent(models.Event{
Uuid: uuid.NewString(),
Body: EncodeMessageBody(body),
Type: models.EventMessageEdit,
Channel: event.Channel,
Sender: event.Sender,
QuoteEventID: body.QuoteEventID,
ChannelID: event.ChannelID,
SenderID: event.SenderID,
Uuid: uuid.NewString(),
Body: EncodeMessageBody(body),
Type: models.EventMessageEdit,
Channel: event.Channel,
Sender: event.Sender,
QuoteEventID: body.QuoteEventID,
RelatedEventID: &event.ID,
ChannelID: event.ChannelID,
SenderID: event.SenderID,
})
if err != nil {
return event, err