mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Replace membership and visibility values with constants (#774)
Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
parent
d283676b9a
commit
f8d2860765
21 changed files with 51 additions and 65 deletions
|
@ -56,7 +56,7 @@ func MakeLeave(
|
|||
Type: "m.room.member",
|
||||
StateKey: &userID,
|
||||
}
|
||||
err = builder.SetContent(map[string]interface{}{"membership": "leave"})
|
||||
err = builder.SetContent(map[string]interface{}{"membership": gomatrixserverlib.Leave})
|
||||
if err != nil {
|
||||
return httputil.LogThenError(httpReq, err)
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ func SendLeave(
|
|||
mem, err := event.Membership()
|
||||
if err != nil {
|
||||
return httputil.LogThenError(httpReq, err)
|
||||
} else if mem != "leave" {
|
||||
} else if mem != gomatrixserverlib.Leave {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
JSON: jsonerror.BadJSON("The membership in the event content must be set to leave"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue