mirror of
https://github.com/matrix-construct/construct
synced 2024-11-05 13:28:54 +01:00
modules/m_event: Tweak conditions for is_power_event().
This commit is contained in:
parent
0cdbe472d1
commit
48f339ac82
1 changed files with 7 additions and 1 deletions
|
@ -1242,6 +1242,9 @@ bool
|
|||
IRCD_MODULE_EXPORT
|
||||
ircd::m::event::auth::is_power_event(const m::event &event)
|
||||
{
|
||||
if(!json::get<"type"_>(event))
|
||||
return false;
|
||||
|
||||
if(json::get<"type"_>(event) == "m.room.create")
|
||||
return true;
|
||||
|
||||
|
@ -1254,7 +1257,10 @@ ircd::m::event::auth::is_power_event(const m::event &event)
|
|||
if(json::get<"type"_>(event) != "m.room.member")
|
||||
return false;
|
||||
|
||||
if(at<"sender"_>(event) == at<"state_key"_>(event))
|
||||
if(!json::get<"sender"_>(event) || !json::get<"state_key"_>(event))
|
||||
return false;
|
||||
|
||||
if(json::get<"sender"_>(event) == json::get<"state_key"_>(event))
|
||||
return false;
|
||||
|
||||
if(membership(event) == "leave" || membership(event) == "ban")
|
||||
|
|
Loading…
Reference in a new issue