Update Valid()

This commit is contained in:
Till Faelligen 2022-10-12 10:38:14 +02:00
parent 6192a64595
commit 01a78f316f
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E
3 changed files with 6 additions and 6 deletions

2
go.mod
View file

@ -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

4
go.sum
View file

@ -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=

View file

@ -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
}