From c15bfefd0dbbd9619c2606b59b784f2a7926ca20 Mon Sep 17 00:00:00 2001 From: kegsay Date: Wed, 11 May 2022 11:29:23 +0100 Subject: Add RoomExists flag to QueryMembershipForUser (#2450) Fixes https://github.com/matrix-org/complement/pull/369 --- roomserver/internal/query/query.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'roomserver/internal/query') 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 { -- cgit v1.2.3