mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-12 09:23:09 -06:00
Check membership is set to leave
This commit is contained in:
parent
36de964d51
commit
d89e727724
|
|
@ -148,6 +148,16 @@ func SendLeave(
|
|||
}
|
||||
}
|
||||
|
||||
// check membership is set to leave
|
||||
if mem, err := event.Membership(); err != nil {
|
||||
return httputil.LogThenError(httpReq, err)
|
||||
} else if mem != "leave" {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON("The membership in the event content must be set to leave"),
|
||||
}
|
||||
}
|
||||
|
||||
// Send the events to the room server.
|
||||
// We are responsible for notifying other servers that the user has left
|
||||
// the room, so set SendAsServer to cfg.Matrix.ServerName
|
||||
|
|
|
|||
Loading…
Reference in a new issue