From 0bf0111dc402b0b9ee86e990d4fc461a3547ba08 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 18 Dec 2023 01:08:23 +0200 Subject: [PATCH] Check membership cache in ensureInvited --- user.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user.go b/user.go index e39d15c5..705aadd7 100644 --- a/user.go +++ b/user.go @@ -192,6 +192,10 @@ func (br *SignalBridge) NewUser(dbUser *database.User) *User { } func (user *User) ensureInvited(intent *appservice.IntentAPI, roomID id.RoomID, isDirect bool) (ok bool) { + if user.bridge.StateStore.GetMembership(roomID, user.MXID) == event.MembershipJoin { + ok = true + return + } extraContent := make(map[string]interface{}) if isDirect { extraContent["is_direct"] = true