Invitation* inv = Invitation::Find(chan, this);
if (inv)
{
- inv->cull();
delete inv;
return true;
}
{
if (!quitting)
ServerInstance->Users->QuitUser(this, "Culled without QuitUser");
- PurgeEmptyChannels();
if (client_sa.sa.sa_family != AF_UNSPEC)
ServerInstance->Users->RemoveCloneCounts(this);
this->SetMode(opermh, true);
this->oper = info;
- this->WriteServ("MODE %s :+o", this->nick.c_str());
+ this->WriteCommand("MODE", "+o");
FOREACH_MOD(OnOper, (this, info->name));
std::string opername;
void LocalUser::Write(const std::string& text)
{
- if (!ServerInstance->SE->BoundsCheckFd(&eh))
+ if (!SocketEngine::BoundsCheckFd(&eh))
return;
if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
this->WriteServ(textbuffer);
}
-void User::WriteNotice(const std::string& text)
+void User::WriteCommand(const char* command, const std::string& text)
{
- this->WriteServ("NOTICE " + (this->registered == REG_ALL ? this->nick : "*") + " :" + text);
+ this->WriteServ(command + (this->registered & REG_NICK ? " " + this->nick : " *") + " " + text);
}
void User::WriteNumeric(unsigned int numeric, const char* text, ...)
return;
const std::string message = InspIRCd::Format(":%s %03u %s %s", ServerInstance->Config->ServerName.c_str(),
- numeric, !this->nick.empty() ? this->nick.c_str() : "*", text.c_str());
+ numeric, this->registered & REG_NICK ? this->nick.c_str() : "*", text.c_str());
this->Write(message);
}
for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
{
LocalUser* u = IS_LOCAL(i->first);
- if (u && !u->quitting && u->already_sent != LocalUser::already_sent_id)
+ if (u && u->already_sent != LocalUser::already_sent_id)
{
u->already_sent = LocalUser::already_sent_id;
u->Write(line);
for (UserMembList::const_iterator i = ulist->begin(); i != ulist->end(); i++)
{
LocalUser* u = IS_LOCAL(i->first);
- if (u && !u->quitting && (u->already_sent != uniq_id))
+ if (u && (u->already_sent != uniq_id))
{
u->already_sent = uniq_id;
u->Write(u->IsOper() ? operMessage : normalMessage);
if (regdone && !c->config->getString("password").empty())
{
- if (ServerInstance->PassCompare(this, c->config->getString("password"), password, c->config->getString("hash")))
+ if (!ServerInstance->PassCompare(this, c->config->getString("password"), password, c->config->getString("hash")))
{
ServerInstance->Logs->Log("CONNECTCLASS", LOG_DEBUG, "Bad password, skipping");
continue;