mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
ircd:Ⓜ️:join: Check argument is my(user).
This commit is contained in:
parent
b72b0ac110
commit
9f1b540319
1 changed files with 16 additions and 0 deletions
|
@ -49,8 +49,18 @@ IRCD_MODULE_EXPORT
|
||||||
ircd::m::join(const room &room,
|
ircd::m::join(const room &room,
|
||||||
const id::user &user_id)
|
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))
|
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::event::id::buf ret;
|
||||||
m::room::bootstrap
|
m::room::bootstrap
|
||||||
{
|
{
|
||||||
|
@ -115,6 +125,12 @@ IRCD_MODULE_EXPORT
|
||||||
ircd::m::join(const m::room::alias &room_alias,
|
ircd::m::join(const m::room::alias &room_alias,
|
||||||
const m::user::id &user_id)
|
const m::user::id &user_id)
|
||||||
{
|
{
|
||||||
|
if(unlikely(!my(user_id)))
|
||||||
|
throw panic
|
||||||
|
{
|
||||||
|
"Can only join my users."
|
||||||
|
};
|
||||||
|
|
||||||
const room::id::buf room_id
|
const room::id::buf room_id
|
||||||
{
|
{
|
||||||
m::room_id(room_alias)
|
m::room_id(room_alias)
|
||||||
|
|
Loading…
Reference in a new issue