mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Do the same for leave
This commit is contained in:
parent
e6be7f05c3
commit
13f9028e7a
1 changed files with 8 additions and 2 deletions
|
@ -175,10 +175,16 @@ func SendLeave(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.StateKey() == nil {
|
if event.StateKey() == nil || event.StateKeyEquals("") {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.InvalidArgumentValue("missing state_key"),
|
JSON: jsonerror.BadJSON("No state key was provided in the leave event."),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !event.StateKeyEquals(event.Sender()) {
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusBadRequest,
|
||||||
|
JSON: jsonerror.BadJSON("Event state key must match the event sender."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue