Skip to content
This repository was archived by the owner on Nov 25, 2024. It is now read-only.

Commit 432c35a

Browse files
S7evinKkegsay
andauthored
Allow user to forget a room, even if they never were a member (#2166)
* Allow user to forget a room, even if they never were a member * Return "M_UNKNOWN" as per the spec Co-authored-by: kegsay <[email protected]>
1 parent 2782ae3 commit 432c35a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

clientapi/routing/membership.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package routing
1717
import (
1818
"context"
1919
"errors"
20+
"fmt"
2021
"net/http"
2122
"time"
2223

@@ -459,13 +460,7 @@ func SendForget(
459460
if membershipRes.IsInRoom {
460461
return util.JSONResponse{
461462
Code: http.StatusBadRequest,
462-
JSON: jsonerror.Forbidden("user is still a member of the room"),
463-
}
464-
}
465-
if !membershipRes.HasBeenInRoom {
466-
return util.JSONResponse{
467-
Code: http.StatusBadRequest,
468-
JSON: jsonerror.Forbidden("user did not belong to room"),
463+
JSON: jsonerror.Unknown(fmt.Sprintf("User %s is in room %s", device.UserID, roomID)),
469464
}
470465
}
471466

0 commit comments

Comments
 (0)