mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Set redacted when parsing the event, since we already store the redacted
event in the database
This commit is contained in:
parent
d95b0cd1ae
commit
61c67722b3
|
|
@ -564,9 +564,10 @@ func (d *EventDatabase) events(
|
||||||
Event: event,
|
Event: event,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if !redactionsArePermanent {
|
if redactionsArePermanent {
|
||||||
d.applyRedactions(results)
|
d.applyRedactions(results)
|
||||||
}
|
}
|
||||||
|
return results, nil
|
||||||
}
|
}
|
||||||
eventJSONs, err := d.EventJSONTable.BulkSelectEventJSON(ctx, txn, eventNIDs)
|
eventJSONs, err := d.EventJSONTable.BulkSelectEventJSON(ctx, txn, eventNIDs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -578,8 +579,9 @@ func (d *EventDatabase) events(
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, eventJSON := range eventJSONs {
|
for _, eventJSON := range eventJSONs {
|
||||||
|
redacted := gjson.GetBytes(eventJSON.EventJSON, "unsigned.redacted_because").Exists()
|
||||||
events[eventJSON.EventNID], err = gomatrixserverlib.NewEventFromTrustedJSONWithEventID(
|
events[eventJSON.EventNID], err = gomatrixserverlib.NewEventFromTrustedJSONWithEventID(
|
||||||
eventIDs[eventJSON.EventNID], eventJSON.EventJSON, false, roomInfo.RoomVersion,
|
eventIDs[eventJSON.EventNID], eventJSON.EventJSON, redacted, roomInfo.RoomVersion,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -599,7 +601,7 @@ func (d *EventDatabase) events(
|
||||||
Event: event,
|
Event: event,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if !redactionsArePermanent {
|
if redactionsArePermanent {
|
||||||
d.applyRedactions(results)
|
d.applyRedactions(results)
|
||||||
}
|
}
|
||||||
return results, nil
|
return results, nil
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue