From 84e37b9635cbb2d8760b5c27a50e32e3c011c8c5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 8 Mar 2018 16:25:52 -0800 Subject: [PATCH] modules/client/account: Fix user account activation related. --- ircd/m/m.cc | 5 ++++- modules/client/account/account.cc | 2 +- modules/client/register.cc | 13 ++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ircd/m/m.cc b/ircd/m/m.cc index 7860c186e..7d16b88c2 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -227,7 +227,10 @@ ircd::m::init::bootstrap() ); create(user::users, me.user_id); - me.activate(); + me.activate( + { + { "active", true } + }); create(my_room, me.user_id); send(my_room, me.user_id, "m.room.name", "", diff --git a/modules/client/account/account.cc b/modules/client/account/account.cc index 87512433a..5ee8d1e00 100644 --- a/modules/client/account/account.cc +++ b/modules/client/account/account.cc @@ -70,7 +70,7 @@ is_active__user(const m::user &user) at<"content"_>(event) }; - ret = content.get("active") == "true"; + ret = content.get("active") == true; }); return ret; diff --git a/modules/client/register.cc b/modules/client/register.cc index 20827dada..73014fa36 100644 --- a/modules/client/register.cc +++ b/modules/client/register.cc @@ -102,7 +102,10 @@ try // for this user in the form of !@user:host and set a key in !users:host // If the user_id is taken this throws 409 Conflict because those assets // will already exist; otherwise the user is registered after this call. - user.activate(); + user.activate( + { + { "active", true } + }); // Set the password for the account. This issues an ircd.password state // event to the user's room. User will be able to login with @@ -291,6 +294,14 @@ _first_user_registered(const m::event &event) at<"state_key"_>(event) }; + const auto &content + { + at<"content"_>(event) + }; + + if(!content.get("active")) + return; + join(m::control, user); already = true; }