aboutsummaryrefslogtreecommitdiff
path: root/roomserver/auth
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-11-16 15:44:53 +0000
committerGitHub <noreply@github.com>2020-11-16 15:44:53 +0000
commit20a01bceb2869c810932eac217d96dc221953685 (patch)
tree639cd8656282ae231a46531f063d7d010320a582 /roomserver/auth
parentd8b526b603683879c012972707cdce44fff3c802 (diff)
Pass pointers to events — reloaded (#1583)
* Pass events as pointers * Fix lint errors * Update gomatrixserverlib * Update gomatrixserverlib * Update to matrix-org/gomatrixserverlib#240
Diffstat (limited to 'roomserver/auth')
-rw-r--r--roomserver/auth/auth.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/roomserver/auth/auth.go b/roomserver/auth/auth.go
index fdcf9f06..aa1d5bc2 100644
--- a/roomserver/auth/auth.go
+++ b/roomserver/auth/auth.go
@@ -25,7 +25,7 @@ import (
func IsServerAllowed(
serverName gomatrixserverlib.ServerName,
serverCurrentlyInRoom bool,
- authEvents []gomatrixserverlib.Event,
+ authEvents []*gomatrixserverlib.Event,
) bool {
historyVisibility := HistoryVisibilityForRoom(authEvents)
@@ -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"
@@ -78,7 +78,7 @@ func HistoryVisibilityForRoom(authEvents []gomatrixserverlib.Event) string {
return visibility
}
-func IsAnyUserOnServerWithMembership(serverName gomatrixserverlib.ServerName, authEvents []gomatrixserverlib.Event, wantMembership string) bool {
+func IsAnyUserOnServerWithMembership(serverName gomatrixserverlib.ServerName, authEvents []*gomatrixserverlib.Event, wantMembership string) bool {
for _, ev := range authEvents {
membership, err := ev.Membership()
if err != nil || membership != wantMembership {