X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=f532b60d1c325e776b1820fb499a415be824db44;hb=e3e748b78683ac005b4c85360806ea6ec27d40c9;hp=c4c9fe9d160508a1de047f1244aa648622577371;hpb=df2c1f5f76e572bca012e79e5f73b38452cd3020;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index c4c9fe9d1..f532b60d1 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -210,9 +210,9 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance memset(snomasks,0,sizeof(snomasks)); if (uid.empty()) - uuid.assign(Instance->GetUID(), 0, UUID_LENGTH); + uuid.assign(Instance->GetUID(), 0, UUID_LENGTH - 1); else - uuid.assign(uid, 0, UUID_LENGTH); + uuid.assign(uid, 0, UUID_LENGTH - 1); ServerInstance->Logs->Log("USERS", DEBUG,"New UUID for user: %s (%s)", uuid.c_str(), uid.empty() ? "allocated new" : "used remote"); @@ -721,7 +721,7 @@ void User::Oper(const std::string &opertype, const std::string &opername) this->WriteServ("MODE %s :+o", this->nick.c_str()); FOREACH_MOD(I_OnOper, OnOper(this, opertype)); ServerInstance->Logs->Log("OPER", DEFAULT, "%s!%s@%s opered as type: %s", this->nick.c_str(), this->ident.c_str(), this->host.c_str(), opertype.c_str()); - this->oper.assign(opertype, 0, NICKMAX - 1); + this->oper.assign(opertype, 0, 512); ServerInstance->Users->all_opers.push_back(this); opertype_t::iterator iter_opertype = ServerInstance->Config->opertypes.find(this->oper.c_str()); @@ -947,9 +947,11 @@ void User::FullConnect() /* Trigger LUSERS output, give modules a chance too */ int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand, OnPreCommand("LUSERS", std::vector(), this, true, "LUSERS")); + std::string command("LUSERS"); + std::vector parameters; + FOREACH_RESULT(I_OnPreCommand, OnPreCommand(command, parameters, this, true, "LUSERS")); if (!MOD_RESULT) - ServerInstance->CallCommandHandler("LUSERS", std::vector(), this); + ServerInstance->CallCommandHandler(command, parameters, this); /* * We don't set REG_ALL until triggering OnUserConnect, so some module events don't spew out stuff @@ -959,6 +961,8 @@ void User::FullConnect() this->registered = REG_ALL; + ServerInstance->PI->Introduce(this); + FOREACH_MOD(I_OnPostConnect,OnPostConnect(this)); ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s] [%s]", this->GetPort(), this->nick.c_str(), this->ident.c_str(), this->host.c_str(), this->GetIPString(), this->fullname.c_str()); @@ -1521,7 +1525,7 @@ bool User::ChangeName(const char* gecos) return false; FOREACH_MOD(I_OnChangeName,OnChangeName(this,gecos)); } - this->fullname.assign(gecos, 0, MAXGECOS+1); + this->fullname.assign(gecos, 0, ServerInstance->Config->Limits.MaxGecos); return true; } @@ -1573,7 +1577,7 @@ bool User::ChangeIdent(const char* newident) if (this->ServerInstance->Config->CycleHosts) this->WriteCommonExcept("%s","QUIT :Changing ident"); - this->ident.assign(newident, 0, IDENTMAX + 1); + this->ident.assign(newident, 0, ServerInstance->Config->Limits.IdentMax + 1); this->InvalidateCache();