diff options
-rw-r--r-- | include/users.h | 2 | ||||
-rw-r--r-- | src/users.c | 14 |
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); |