From 5ac1e9175d90fad5feaf235dfe225ddffc47f257 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 19 Jun 2013 18:59:26 -0400 Subject: 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 --- src/users.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/users.cpp') 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::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(); -- cgit