0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-16 08:58:20 +02:00
construct/modules/m_user.cc
2019-07-15 11:06:01 -07:00

43 lines
950 B
C++

// 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.
ircd::mapi::header
IRCD_MODULE
{
"Matrix user library; modular components."
};
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;
}