mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Add RoomExists flag to QueryMembershipForUser (#2450)
Fixes https://github.com/matrix-org/complement/pull/369
This commit is contained in:
parent
6db08b2874
commit
c15bfefd0d
6 changed files with 38 additions and 5 deletions
|
@ -122,6 +122,7 @@ type QueryMembershipForUserResponse struct {
|
|||
Membership string `json:"membership"`
|
||||
// True if the user asked to forget this room.
|
||||
IsRoomForgotten bool `json:"is_room_forgotten"`
|
||||
RoomExists bool `json:"room_exists"`
|
||||
}
|
||||
|
||||
// QueryMembershipsForRoomRequest is a request to QueryMembershipsForRoom
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue