diff --git a/include/ircd/m/node.h b/include/ircd/m/node.h index fc439c565..40788541f 100644 --- a/include/ircd/m/node.h +++ b/include/ircd/m/node.h @@ -41,6 +41,8 @@ struct ircd::m::node id node_id; + operator const id &() const; + id::room room_id(const mutable_buffer &) const; id::room::buf room_id() const; @@ -66,3 +68,10 @@ struct ircd::m::node::room room(const room &) = delete; room &operator=(const room &) = delete; }; + +inline ircd::m::node::operator +const ircd::m::node::id &() +const +{ + return node_id; +} diff --git a/include/ircd/m/room.h b/include/ircd/m/room.h index f0f723041..f48b6247b 100644 --- a/include/ircd/m/room.h +++ b/include/ircd/m/room.h @@ -96,7 +96,7 @@ struct ircd::m::room id room_id; event::id event_id; - operator const id &() const { return room_id; } + operator const id &() const; // Convenience passthru to room::state (logarithmic query) bool has(const string_view &type, const string_view &state_key) const; @@ -324,3 +324,10 @@ struct ircd::m::room::state::tuple }; #pragma GCC diagnostic pop + +inline ircd::m::room::operator +const ircd::m::room::id &() +const +{ + return room_id; +} diff --git a/include/ircd/m/user.h b/include/ircd/m/user.h index 91f3589f5..49bb38c7e 100644 --- a/include/ircd/m/user.h +++ b/include/ircd/m/user.h @@ -27,6 +27,8 @@ struct ircd::m::user id user_id; + operator const id &() const; + static m::room users; static m::room tokens; @@ -61,3 +63,10 @@ struct ircd::m::user::room room(const room &) = delete; room &operator=(const room &) = delete; }; + +inline ircd::m::user::operator +const ircd::m::user::id &() +const +{ + return user_id; +}