0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00
construct/modules/m_user.cc

43 lines
950 B
C++
Raw Normal View History

// 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-07-15 19:09:26 +02:00
ircd::mapi::header
IRCD_MODULE
{
"Matrix user library; modular components."
};
2019-07-15 19:09:26 +02:00
ircd::m::user
ircd::m::create(const m::user::id &user_id,
const json::members &contents)
{
const m::user user
{
user_id
};
const m::room::id::buf user_room_id
{
user.room_id()
};
//TODO: ABA
//TODO: TXN
m::room user_room
{
m::create(user_room_id, m::me.user_id, "user")
};
//TODO: ABA
//TODO: TXN
send(user.users, m::me.user_id, "ircd.user", user.user_id, contents);
return user;
}