summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-25 20:21:59 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-05-25 20:21:59 +0000
commit1e2e80bf75ae7c7fd0737f64bc0248eada9e6fdc (patch)
tree26aad4e3bb4b5f2cb8544a7e28d9c567ecb60036
parentdc3744a71ca2db4a938ef0ae41ec551f708ceb02 (diff)
Changed User::AutoID to always log in the user to the core, and to set usermode +r on users that should be. Fixes everyone being identified but not usermode +r on inspircd 1.2
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2985 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--include/users.h2
-rw-r--r--src/users.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/include/users.h b/include/users.h
index ff7c74622..46ed14b13 100644
--- a/include/users.h
+++ b/include/users.h
@@ -159,7 +159,7 @@ class CoreExport User : public Extensible
/** Auto identify the user to the given accountname.
* @param account Display nick of account
*/
- void AutoID(const char *acc);
+ void AutoID(const std::string &account);
/** Login the user to a NickCore
* @param core The account the user is useing
diff --git a/src/users.c b/src/users.c
index 26e50a40d..16d85796d 100644
--- a/src/users.c
+++ b/src/users.c
@@ -418,20 +418,22 @@ void User::CheckAuthenticationToken(const char *svid)
/** Auto identify the user to the given accountname.
* @param account Display nick of account
*/
-void User::AutoID(const char *account)
+void User::AutoID(const std::string &account)
{
- NickCore *tnc;
- NickAlias *na;
+ NickCore *core = findcore(account.c_str());
- if ((tnc = findcore(account)))
+ if (core)
{
- if ((na = findnick(this->nick)) && na->nc == tnc)
+ this->Login(core);
+
+ NickAlias *na = findnick(this->nick);
+ if (na && na->nc == core)
{
if (na->last_realname)
delete [] na->last_realname;
na->last_realname = sstrdup(this->realname);
na->last_seen = time(NULL);
- this->Login(na->nc);
+ this->SetMode(findbot(Config.s_NickServ), UMODE_REGISTERED);
this->UpdateHost();
check_memos(this);