mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️ Add conditionals to bootstrap() operations.
This commit is contained in:
parent
85d1c924a5
commit
8038faf8e0
1 changed files with 35 additions and 22 deletions
57
ircd/m/m.cc
57
ircd/m/m.cc
|
@ -261,34 +261,47 @@ ircd::m::init::bootstrap()
|
||||||
" database and start over."
|
" database and start over."
|
||||||
};
|
};
|
||||||
|
|
||||||
create(user::users, me.user_id);
|
if(!exists(user::users))
|
||||||
|
create(user::users, me.user_id);
|
||||||
|
|
||||||
create(my_room, me.user_id);
|
if(!exists(my_room))
|
||||||
create(me.user_id);
|
create(my_room, me.user_id);
|
||||||
me.activate();
|
|
||||||
|
|
||||||
join(my_room, me.user_id);
|
if(!exists(me))
|
||||||
|
|
||||||
send(my_room, me.user_id, "m.room.name", "",
|
|
||||||
{
|
{
|
||||||
{ "name", "IRCd's Room" }
|
create(me.user_id);
|
||||||
});
|
me.activate();
|
||||||
|
}
|
||||||
|
|
||||||
send(my_room, me.user_id, "m.room.topic", "",
|
if(!my_room.membership(me.user_id, "join"))
|
||||||
{
|
join(my_room, me.user_id);
|
||||||
{ "topic", "The daemon's den." }
|
|
||||||
});
|
|
||||||
|
|
||||||
send(user::users, me.user_id, "m.room.name", "",
|
if(!my_room.has("m.room.name", ""))
|
||||||
{
|
send(my_room, me.user_id, "m.room.name", "",
|
||||||
{ "name", "Users" }
|
{
|
||||||
});
|
{ "name", "IRCd's Room" }
|
||||||
|
});
|
||||||
|
|
||||||
create(user::tokens, me.user_id);
|
if(!my_room.has("m.room.topic", ""))
|
||||||
send(user::tokens, me.user_id, "m.room.name", "",
|
send(my_room, me.user_id, "m.room.topic", "",
|
||||||
{
|
{
|
||||||
{ "name", "User Tokens" }
|
{ "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))
|
||||||
|
create(user::tokens, me.user_id);
|
||||||
|
|
||||||
|
if(!user::tokens.has("m.room.name",""))
|
||||||
|
send(user::tokens, me.user_id, "m.room.name", "",
|
||||||
|
{
|
||||||
|
{ "name", "User Tokens" }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in a new issue