0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-29 08:54:02 +01:00

modules/m_event: Check for target membership auth event first here.

This commit is contained in:
Jason Volk 2019-04-18 14:36:17 -07:00
parent 6eeb8da71d
commit 8428774a25

View file

@ -943,10 +943,10 @@ ircd::m::event::auth::failed(const m::event &event,
// user's current membership state is invite or join. // user's current membership state is invite or join.
if(json::get<"sender"_>(event) == json::get<"state_key"_>(event)) if(json::get<"sender"_>(event) == json::get<"state_key"_>(event))
{ {
if(membership(*auth_member_target) == "join") if(auth_member_target && membership(*auth_member_target) == "join")
return {}; return {};
if(membership(*auth_member_target) == "invite") if(auth_member_target && membership(*auth_member_target) == "invite")
return {}; return {};
return "m.room.member membership=leave self-target must have membership=join|invite."; return "m.room.member membership=leave self-target must have membership=join|invite.";