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
|
var succeeded bool
|
||||||
defer sqlutil.EndTransactionWithCheck(snapshot, &succeeded, &err)
|
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())
|
validRoomID, err := spec.NewRoomID(event.RoomID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return event, err
|
return event, err
|
||||||
|
@ -577,10 +570,18 @@ func (s *OutputRoomEventConsumer) updateStateEvent(event *rstypes.HeaderedEvent)
|
||||||
if err == nil && sku != nil {
|
if err == nil && sku != nil {
|
||||||
sKey := sku.String()
|
sKey := sku.String()
|
||||||
event.StateKeyResolved = &sKey
|
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())
|
userID, err := s.rsAPI.QueryUserIDForSender(s.ctx, *validRoomID, event.SenderID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return event, err
|
return event, err
|
||||||
|
|
Loading…
Reference in a new issue