0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 00:10:59 +01:00

ircd:Ⓜ️ Eliminate the user::users room references.

This commit is contained in:
Jason Volk 2019-08-11 22:30:27 -07:00
parent cd477e8ce7
commit f24bf54799
3 changed files with 3 additions and 35 deletions

View file

@ -46,7 +46,6 @@ struct ircd::m::user
using closure = std::function<void (const user &)>; using closure = std::function<void (const user &)>;
using closure_bool = std::function<bool (const user &)>; using closure_bool = std::function<bool (const user &)>;
static m::room users;
static m::room tokens; static m::room tokens;
id user_id; id user_id;

View file

@ -481,9 +481,6 @@ ircd::m::self::init::init(const string_view &origin,
ircd_room_id = {"ircd", origin}; ircd_room_id = {"ircd", origin};
m::my_room = {ircd_room_id}; m::my_room = {ircd_room_id};
users_room_id = {"users", origin};
m::user::users = {users_room_id};
tokens_room_id = {"tokens", origin}; tokens_room_id = {"tokens", origin};
m::user::tokens = {tokens_room_id}; m::user::tokens = {tokens_room_id};
@ -2560,25 +2557,6 @@ ircd::m::rooms::count_public(const string_view &server)
// m/user.h // m/user.h
// //
/// ID of the room which indexes all users (an instance of the room is
/// provided below).
ircd::m::room::id::buf
users_room_id
{
"users", ircd::my_host()
};
/// The users room is the database of all users. It primarily serves as an
/// indexing mechanism and for top-level user related keys. Accounts
/// registered on this server will be among state events in this room.
/// Users do not have access to this room, it is used internally.
///
ircd::m::room
ircd::m::user::users
{
users_room_id
};
/// ID of the room which stores ephemeral tokens (an instance of the room is /// ID of the room which stores ephemeral tokens (an instance of the room is
/// provided below). /// provided below).
ircd::m::room::id::buf ircd::m::room::id::buf

View file

@ -29,18 +29,15 @@ try
" database and start over." " database and start over."
}; };
if(!exists(user::users))
create(user::users, me.user_id, "internal");
if(!exists(my_room))
create(my_room, me.user_id, "internal");
if(!exists(me)) if(!exists(me))
{ {
create(me.user_id); create(me.user_id);
me.activate(); me.activate();
} }
if(!exists(my_room))
create(my_room, me.user_id, "internal");
if(!my_room.membership(me.user_id, "join")) if(!my_room.membership(me.user_id, "join"))
join(my_room, me.user_id); join(my_room, me.user_id);
@ -56,12 +53,6 @@ try
{ "topic", "The daemon's den." } { "topic", "The daemon's den." }
}); });
if(!user::users.has("m.room.name", ""))
send(user::users, me.user_id, "m.room.name", "",
{
{ "name", "Users" }
});
if(!exists(user::tokens)) if(!exists(user::tokens))
create(user::tokens, me.user_id); create(user::tokens, me.user_id);