From 01a78f316fd530330454301661a2d022f1443fd6 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:38:14 +0200 Subject: [PATCH] Update Valid() --- go.mod | 2 +- go.sum | 4 ++++ roomserver/internal/helpers/auth.go | 6 +----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ba9cfebbb..5eea65c4e 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/matrix-org/dugong v0.0.0-20210921133753-66e6b1c67e2e github.com/matrix-org/go-sqlite3-js v0.0.0-20220419092513-28aa791a1c91 github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 - github.com/matrix-org/gomatrixserverlib v0.0.0-20221012074709-35dad21e1a8b + github.com/matrix-org/gomatrixserverlib v0.0.0-20221012083703-58d874bb946c github.com/matrix-org/pinecone v0.0.0-20220929155234-2ce51dd4a42c github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 github.com/mattn/go-sqlite3 v1.14.15 diff --git a/go.sum b/go.sum index a43215603..1e1823975 100644 --- a/go.sum +++ b/go.sum @@ -386,6 +386,10 @@ github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5d github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= github.com/matrix-org/gomatrixserverlib v0.0.0-20221012074709-35dad21e1a8b h1:DELQ13s27W+wV6jX28O7+u+xSgacgcl0Ky1fjF/wnV4= github.com/matrix-org/gomatrixserverlib v0.0.0-20221012074709-35dad21e1a8b/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= +github.com/matrix-org/gomatrixserverlib v0.0.0-20221012083245-51ffebc3e633 h1:pR2wrPRjMR9VqlxSxtAfeo1TMQQMjYCx5m+kmEMV5Mc= +github.com/matrix-org/gomatrixserverlib v0.0.0-20221012083245-51ffebc3e633/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= +github.com/matrix-org/gomatrixserverlib v0.0.0-20221012083703-58d874bb946c h1:tKB19KYKI7nDQXEdXH3IdZ5pkpQM8aKJuwFulVpTirg= +github.com/matrix-org/gomatrixserverlib v0.0.0-20221012083703-58d874bb946c/go.mod h1:Mtifyr8q8htcBeugvlDnkBcNUy5LO8OzUoplAf1+mb4= github.com/matrix-org/pinecone v0.0.0-20220929155234-2ce51dd4a42c h1:iCHLYwwlPsf4TYFrvhKdhQoAM2lXzcmDZYqwBNWcnVk= github.com/matrix-org/pinecone v0.0.0-20220929155234-2ce51dd4a42c/go.mod h1:K0N1ixHQxXoCyqolDqVxPM3ArrDtcMs8yegOx2Lfv9k= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= diff --git a/roomserver/internal/helpers/auth.go b/roomserver/internal/helpers/auth.go index e9a57d8da..a10bfc85b 100644 --- a/roomserver/internal/helpers/auth.go +++ b/roomserver/internal/helpers/auth.go @@ -133,12 +133,8 @@ type authEvents struct { } // Valid verifies that all auth events are from the same room. -func (ae *authEvents) Valid() bool { - roomID := "" +func (ae *authEvents) Valid(roomID string) bool { for i := range ae.events { - if i == 0 { - roomID = ae.events[i].RoomID() - } if roomID != ae.events[i].RoomID() { return false }