summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-06-19 18:59:26 -0400
committerAdam <Adam@anope.org>2013-06-19 19:03:56 -0400
commit5ac1e9175d90fad5feaf235dfe225ddffc47f257 (patch)
tree729e5c1b34e2c23f1c5cdba427e52958b1b17ff0 /src/users.cpp
parent5695c9e079278e74692d55581769745c833bc284 (diff)
Set vhosts when users id to an account (and not a nick), add account arg to user ctor to ease handling users who connect already identified
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index cc99cd63e..cd3c6b50f 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -32,7 +32,7 @@ time_t MaxUserTime = 0;
std::list<User *> User::quitting_users;
-User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid)
+User::User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid, NickCore *account)
{
if (snick.empty() || sident.empty() || shost.empty())
throw CoreException("Bad args passed to User::User");
@@ -55,6 +55,7 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope:
this->SetModesInternal("%s", smodes.c_str());
this->uid = suid;
this->super_admin = false;
+ this->nc = NULL;
size_t old = UserListByNick.size();
UserListByNick[snick] = this;
@@ -63,7 +64,7 @@ User::User(const Anope::string &snick, const Anope::string &sident, const Anope:
if (old == UserListByNick.size())
Log(LOG_DEBUG) << "Duplicate user " << snick << " in user table?";
- this->nc = NULL;
+ this->Login(account);
this->UpdateHost();
if (sserver && sserver->IsSynced()) // Our bots are introduced on startup with no server
@@ -326,7 +327,7 @@ void User::Identify(NickAlias *na)
void User::Login(NickCore *core)
{
- if (core == this->nc)
+ if (!core || core == this->nc)
return;
this->Logout();