mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/federation/send_*: Allow for missing top-level membership in all checks.
This commit is contained in:
parent
13f38782f5
commit
4457f4442e
2 changed files with 4 additions and 2 deletions
|
@ -95,7 +95,7 @@ put__send_join(client &client,
|
||||||
"Event type must be m.room.member"
|
"Event type must be m.room.member"
|
||||||
};
|
};
|
||||||
|
|
||||||
if(json::get<"membership"_>(event) != "join")
|
if(json::get<"membership"_>(event) && json::get<"membership"_>(event) != "join")
|
||||||
throw m::error
|
throw m::error
|
||||||
{
|
{
|
||||||
http::NOT_MODIFIED, "M_INVALID_MEMBERSHIP",
|
http::NOT_MODIFIED, "M_INVALID_MEMBERSHIP",
|
||||||
|
@ -118,6 +118,7 @@ put__send_join(client &client,
|
||||||
|
|
||||||
m::vm::opts vmopts;
|
m::vm::opts vmopts;
|
||||||
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
||||||
|
vmopts.non_conform.set(m::event::conforms::MISSING_MEMBERSHIP);
|
||||||
m::vm::eval eval
|
m::vm::eval eval
|
||||||
{
|
{
|
||||||
event, vmopts
|
event, vmopts
|
||||||
|
|
|
@ -95,7 +95,7 @@ put__send_leave(client &client,
|
||||||
"Event type must be m.room.member"
|
"Event type must be m.room.member"
|
||||||
};
|
};
|
||||||
|
|
||||||
if(json::get<"membership"_>(event) != "leave")
|
if(json::get<"membership"_>(event) && json::get<"membership"_>(event) != "leave")
|
||||||
throw m::error
|
throw m::error
|
||||||
{
|
{
|
||||||
http::NOT_MODIFIED, "M_INVALID_MEMBERSHIP",
|
http::NOT_MODIFIED, "M_INVALID_MEMBERSHIP",
|
||||||
|
@ -118,6 +118,7 @@ put__send_leave(client &client,
|
||||||
|
|
||||||
m::vm::opts vmopts;
|
m::vm::opts vmopts;
|
||||||
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
|
||||||
|
vmopts.non_conform.set(m::event::conforms::MISSING_MEMBERSHIP);
|
||||||
m::vm::eval eval
|
m::vm::eval eval
|
||||||
{
|
{
|
||||||
event, vmopts
|
event, vmopts
|
||||||
|
|
Loading…
Reference in a new issue