Honour history_visibility when backfilling (#990)

* Make backfill work for shared history visibility

* fetch missing state on backfill to remember snapshots correctly

* Fix gmsl to not mux in auth events into room state

* Whoops

* Linting
This commit is contained in:
Kegsay 2020-04-29 18:41:45 +01:00 committed by GitHub
parent 458b364781
commit 4ad52c67ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 195 additions and 52 deletions

View file

@ -27,7 +27,7 @@ func IsServerAllowed(
serverCurrentlyInRoom bool,
authEvents []gomatrixserverlib.Event,
) bool {
historyVisibility := historyVisibilityForRoom(authEvents)
historyVisibility := HistoryVisibilityForRoom(authEvents)
// 1. If the history_visibility was set to world_readable, allow.
if historyVisibility == "world_readable" {
@ -52,7 +52,7 @@ func IsServerAllowed(
return false
}
func historyVisibilityForRoom(authEvents []gomatrixserverlib.Event) string {
func HistoryVisibilityForRoom(authEvents []gomatrixserverlib.Event) string {
// https://matrix.org/docs/spec/client_server/r0.6.0#id87
// By default if no history_visibility is set, or if the value is not understood, the visibility is assumed to be shared.
visibility := "shared"