Fix getting prev content
This commit is contained in:
parent
2b3b355ebd
commit
302d8d7089
|
@ -558,13 +558,6 @@ func (s *OutputRoomEventConsumer) updateStateEvent(event *rstypes.HeaderedEvent)
|
|||
var succeeded bool
|
||||
defer sqlutil.EndTransactionWithCheck(snapshot, &succeeded, &err)
|
||||
|
||||
prevEvent, err := snapshot.GetStateEvent(
|
||||
s.ctx, event.RoomID(), event.Type(), stateKey,
|
||||
)
|
||||
if err != nil {
|
||||
return event, err
|
||||
}
|
||||
|
||||
validRoomID, err := spec.NewRoomID(event.RoomID())
|
||||
if err != nil {
|
||||
return event, err
|
||||
|
@ -577,10 +570,18 @@ func (s *OutputRoomEventConsumer) updateStateEvent(event *rstypes.HeaderedEvent)
|
|||
if err == nil && sku != nil {
|
||||
sKey := sku.String()
|
||||
event.StateKeyResolved = &sKey
|
||||
stateKey = sKey
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prevEvent, err := snapshot.GetStateEvent(
|
||||
s.ctx, event.RoomID(), event.Type(), stateKey,
|
||||
)
|
||||
if err != nil {
|
||||
return event, err
|
||||
}
|
||||
|
||||
userID, err := s.rsAPI.QueryUserIDForSender(s.ctx, *validRoomID, event.SenderID())
|
||||
if err != nil {
|
||||
return event, err
|
||||
|
|
Loading…
Reference in a new issue