mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 16:33:53 +01:00
ircd:Ⓜ️ Add back the id::NODE sigil; add to room_id() translation.
This commit is contained in:
parent
b60edf3212
commit
f74ddd0171
3 changed files with 11 additions and 1 deletions
|
@ -127,6 +127,7 @@ enum ircd::m::id::sigil
|
|||
ROOM_ALIAS = '#', ///< Room alias (4.2.3)
|
||||
GROUP = '+', ///< Group ID (experimental)
|
||||
DEVICE = '%', ///< Device ID (experimental)
|
||||
NODE = ':', ///< Node ID (experimental)
|
||||
};
|
||||
|
||||
/// (Appendix 4.2.1) User Identifiers
|
||||
|
|
|
@ -29,6 +29,7 @@ struct ircd::m::id::input
|
|||
const rule<id::sigil> room_alias_sigil { lit(char(id::ROOM_ALIAS)) ,"room_alias sigil" };
|
||||
const rule<id::sigil> group_id_sigil { lit(char(id::GROUP)) ,"group_id sigil" };
|
||||
const rule<id::sigil> device_sigil { lit(char(id::DEVICE)) ,"device sigil" };
|
||||
const rule<id::sigil> node_sigil { lit(char(id::NODE)) ,"node sigil" };
|
||||
const rule<id::sigil> sigil
|
||||
{
|
||||
event_id_sigil |
|
||||
|
@ -36,7 +37,8 @@ struct ircd::m::id::input
|
|||
room_id_sigil |
|
||||
room_alias_sigil |
|
||||
group_id_sigil |
|
||||
device_sigil
|
||||
device_sigil |
|
||||
node_sigil
|
||||
,"sigil"
|
||||
};
|
||||
|
||||
|
@ -1019,6 +1021,7 @@ ircd::m::reflect(const id::sigil &c)
|
|||
case id::ROOM_ALIAS: return "ROOM_ALIAS"_sv;
|
||||
case id::GROUP: return "GROUP"_sv;
|
||||
case id::DEVICE: return "DEVICE"_sv;
|
||||
case id::NODE: return "NODE"_sv;
|
||||
}
|
||||
|
||||
return "?????"_sv;
|
||||
|
|
|
@ -821,6 +821,12 @@ ircd::m::room_id(const mutable_buffer &out,
|
|||
return string_view{data(out), copy(out, user_room.room_id)};
|
||||
}
|
||||
|
||||
case id::NODE:
|
||||
{
|
||||
const m::node node(lstrip(room_id_or_alias, ':'));
|
||||
return node.room_id(out);
|
||||
}
|
||||
|
||||
default:
|
||||
return room_id(out, id::room_alias{room_id_or_alias});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue