aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/query
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2022-05-11 11:29:23 +0100
committerGitHub <noreply@github.com>2022-05-11 11:29:23 +0100
commitc15bfefd0dbbd9619c2606b59b784f2a7926ca20 (patch)
tree528579b85f7c504430d4e2d05485d02a9fbc4b4d /roomserver/internal/query
parent6db08b2874307c516b10ef9c9e996807fbfdb1ff (diff)
Add RoomExists flag to QueryMembershipForUser (#2450)
Fixes https://github.com/matrix-org/complement/pull/369
Diffstat (limited to 'roomserver/internal/query')
-rw-r--r--roomserver/internal/query/query.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go
index 5b33ec3c..d25bdc37 100644
--- a/roomserver/internal/query/query.go
+++ b/roomserver/internal/query/query.go
@@ -169,8 +169,10 @@ func (r *Queryer) QueryMembershipForUser(
return err
}
if info == nil {
- return fmt.Errorf("QueryMembershipForUser: unknown room %s", request.RoomID)
+ response.RoomExists = false
+ return nil
}
+ response.RoomExists = true
membershipEventNID, stillInRoom, isRoomforgotten, err := r.DB.GetMembership(ctx, info.RoomNID, request.UserID)
if err != nil {