0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:Ⓜ️:join: Check argument is my(user).

This commit is contained in:
Jason Volk 2019-08-03 01:44:28 -07:00
parent b72b0ac110
commit 9f1b540319

View file

@ -49,8 +49,18 @@ IRCD_MODULE_EXPORT
ircd::m::join(const room &room,
const id::user &user_id)
{
if(unlikely(!my(user_id)))
throw panic
{
"Can only join my users."
};
// Branch for when nothing is known about the room.
if(!exists(room))
{
// The bootstrap condcts a blocking make_join and issues a join
// event, returning the event_id; afterward asynchronously it will
// attempt a send_join, and then process the room events.
m::event::id::buf ret;
m::room::bootstrap
{
@ -115,6 +125,12 @@ IRCD_MODULE_EXPORT
ircd::m::join(const m::room::alias &room_alias,
const m::user::id &user_id)
{
if(unlikely(!my(user_id)))
throw panic
{
"Can only join my users."
};
const room::id::buf room_id
{
m::room_id(room_alias)