0
0
Fork 0
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:
Jason Volk 2018-06-30 18:49:38 -07:00
parent 85d1c924a5
commit 8038faf8e0

View file

@ -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" }
});
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////