mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 15:30:52 +01:00
ircd:Ⓜ️:event::auth: Update version requirement.
This commit is contained in:
parent
e6780c7940
commit
6a2c5f2047
1 changed files with 25 additions and 2 deletions
|
@ -1836,8 +1836,31 @@ ircd::m::event::auth::failed(const m::event &event,
|
|||
// c. If content.room_version is present and is not a recognised
|
||||
// version, reject.
|
||||
if(json::get<"content"_>(event).has("room_version"))
|
||||
if(unquote(json::get<"content"_>(event).get("room_version")) != "1")
|
||||
return "m.room.create room_version is not recognized.";
|
||||
{
|
||||
const json::string &claim_version(json::get<"content"_>(event).get("room_version", "1"));
|
||||
const string_view &id_version(event.event_id.version());
|
||||
if(claim_version == "3")
|
||||
{
|
||||
if(id_version != "3")
|
||||
return "m.room.create room_version not 3";
|
||||
}
|
||||
else if(claim_version == "4")
|
||||
{
|
||||
if(id_version != "4")
|
||||
return "m.room.create room_version not 4";
|
||||
}
|
||||
else if(claim_version == "1" || claim_version == "2")
|
||||
{
|
||||
//if(id_version != "1")
|
||||
// return "m.room.create room_version not 1";
|
||||
}
|
||||
else if(claim_version != "1" && claim_version != "2")
|
||||
{
|
||||
if(id_version != "4")
|
||||
return "m.room.create room_version not 4";
|
||||
}
|
||||
else assert(0);
|
||||
}
|
||||
|
||||
// d. If content has no creator field, reject.
|
||||
assert(!empty(json::get<"content"_>(event).get("creator")));
|
||||
|
|
Loading…
Reference in a new issue