mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-03 06:32:47 +00:00
Implement history visibility checks for /messages
This commit is contained in:
parent
c8dd962505
commit
5d9c10cb8f
3 changed files with 149 additions and 4 deletions
|
@ -243,7 +243,11 @@ func (r *messagesReq) retrieveEvents() (
|
|||
events = reversed(events)
|
||||
}
|
||||
|
||||
events = internal.ApplyHistoryVisibilityChecks(r.ctx, r.requester, events)
|
||||
events = internal.ApplyHistoryVisibilityChecks(r.ctx, r.rsAPI, r.requester, events)
|
||||
// If we fitered out all the events from these checks, return early
|
||||
if len(events) == 0 {
|
||||
return []gomatrixserverlib.ClientEvent{}, *r.from, *r.to, nil
|
||||
}
|
||||
|
||||
// Convert all of the events into client events.
|
||||
clientEvents = gomatrixserverlib.HeaderedToClientEvents(events, gomatrixserverlib.FormatAll)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue