2018-03-05 17:53:48 +01:00
|
|
|
// Matrix Construct
|
|
|
|
//
|
|
|
|
// Copyright (C) Matrix Construct Developers, Authors & Contributors
|
|
|
|
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
|
|
|
|
//
|
|
|
|
// Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice is present in all copies. The
|
|
|
|
// full license for this software is available in the LICENSE file.
|
|
|
|
|
2019-06-22 05:59:41 +02:00
|
|
|
ircd::m::node
|
|
|
|
IRCD_MODULE_EXPORT
|
|
|
|
ircd::m::create(const node &node,
|
|
|
|
const json::members &args)
|
2018-03-05 17:53:48 +01:00
|
|
|
{
|
2019-05-27 02:44:12 +02:00
|
|
|
assert(node.node_id);
|
2018-03-05 17:53:48 +01:00
|
|
|
const m::room::id::buf room_id
|
|
|
|
{
|
|
|
|
node.room_id()
|
|
|
|
};
|
|
|
|
|
|
|
|
create(room_id, m::me.user_id);
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2019-06-22 05:59:41 +02:00
|
|
|
bool
|
|
|
|
IRCD_MODULE_EXPORT
|
|
|
|
ircd::m::exists(const node &node)
|
2018-03-05 17:53:48 +01:00
|
|
|
{
|
2019-08-12 07:42:12 +02:00
|
|
|
const m::room::id::buf room_id
|
|
|
|
{
|
|
|
|
node.room_id()
|
|
|
|
};
|
|
|
|
|
|
|
|
return exists(room_id);
|
2018-03-05 17:53:48 +01:00
|
|
|
}
|
|
|
|
|
2019-06-22 05:59:41 +02:00
|
|
|
bool
|
|
|
|
IRCD_MODULE_EXPORT
|
|
|
|
ircd::m::my(const node &node)
|
2018-03-05 17:53:48 +01:00
|
|
|
{
|
2019-06-22 05:59:41 +02:00
|
|
|
return my_host(node.node_id);
|
2018-03-05 17:53:48 +01:00
|
|
|
}
|