mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-22 14:21:55 -06:00
Don't 500 /messages
if we can't apply history visibility correctly
This commit is contained in:
parent
c85bc3434f
commit
c6bcbb0a18
|
@ -362,13 +362,16 @@ func (r *messagesReq) retrieveEvents() (
|
||||||
|
|
||||||
// Apply room history visibility filter
|
// Apply room history visibility filter
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
filteredEvents, err := internal.ApplyHistoryVisibilityFilter(r.ctx, r.snapshot, r.rsAPI, events, nil, r.device.UserID, "messages")
|
filteredEvents := events
|
||||||
logrus.WithFields(logrus.Fields{
|
if filtered, ferr := internal.ApplyHistoryVisibilityFilter(r.ctx, r.snapshot, r.rsAPI, events, nil, r.device.UserID, "messages"); ferr == nil {
|
||||||
"duration": time.Since(startTime),
|
filteredEvents = filtered
|
||||||
"room_id": r.roomID,
|
logrus.WithFields(logrus.Fields{
|
||||||
"events_before": len(events),
|
"duration": time.Since(startTime),
|
||||||
"events_after": len(filteredEvents),
|
"room_id": r.roomID,
|
||||||
}).Debug("applied history visibility (messages)")
|
"events_before": len(events),
|
||||||
|
"events_after": len(filteredEvents),
|
||||||
|
}).Debug("applied history visibility (messages)")
|
||||||
|
}
|
||||||
return gomatrixserverlib.HeaderedToClientEvents(filteredEvents, gomatrixserverlib.FormatAll), start, end, err
|
return gomatrixserverlib.HeaderedToClientEvents(filteredEvents, gomatrixserverlib.FormatAll), start, end, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue