aboutsummaryrefslogtreecommitdiff
path: root/roomserver
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-08-27 11:47:13 +0100
committerGitHub <noreply@github.com>2020-08-27 11:47:13 +0100
commit034e5d5a55ca2781372ba4c789c2a5e5205060cd (patch)
treefb25d4c1d8d8888a9973cce6402d32d0462fad0f /roomserver
parent7466e6b7186610ee8696c2d4db7aa1138c24adbe (diff)
Speed up accepting invites from remote users if we're already in the room (#1349)
Diffstat (limited to 'roomserver')
-rw-r--r--roomserver/internal/perform_join.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/roomserver/internal/perform_join.go b/roomserver/internal/perform_join.go
index b92a6663..3b9b1b3c 100644
--- a/roomserver/internal/perform_join.go
+++ b/roomserver/internal/perform_join.go
@@ -161,8 +161,9 @@ func (r *RoomserverInternalAPI) performJoinRoomByID(
// where we might think we know about a room in the following
// section but don't know the latest state as all of our users
// have left.
+ serverInRoom, _ := r.isServerCurrentlyInRoom(ctx, r.ServerName, req.RoomIDOrAlias)
isInvitePending, inviteSender, _, err := r.isInvitePending(ctx, req.RoomIDOrAlias, req.UserID)
- if err == nil && isInvitePending {
+ if err == nil && isInvitePending && !serverInRoom {
// Check if there's an invite pending.
_, inviterDomain, ierr := gomatrixserverlib.SplitID('@', inviteSender)
if ierr != nil {