*/
std::string sendq;
- /** Message user will quit with. Not to be set externally.
- */
- std::string quitmsg;
-
- /** Quit message shown to opers - not to be set externally.
- */
- std::string operquitmsg;
-
/** Whether or not to send an snotice about this user's quitting
*/
bool quietquit;
*/
void ShowRULES();
- /** Set oper-specific quit message shown to opers only when the user quits
- * (overrides any sent by QuitUser)
- */
- void SetOperQuit(const std::string &oquit);
-
- /** Get oper-specific quit message shown only to opers when the user quits.
- * (overrides any sent by QuitUser)
- */
- const std::string& GetOperQuit();
-
/** Increases a user's command penalty by a set amount.
*/
void IncreasePenalty(int increase);
else
quitmsg = parameters.size() ? parameters[0] : "Client exited";
- ServerInstance->Users->QuitUser(user, quitmsg);
+ std::string* operquit;
+ if (user->GetExt("operquit", operquit))
+ {
+ ServerInstance->Users->QuitUser(user, quitmsg, operquit->c_str());
+ delete operquit;
+ }
+ else
+ {
+ ServerInstance->Users->QuitUser(user, quitmsg);
+ }
return CMD_SUCCESS;
}
if (!IS_LOCAL(source))
return; // Only start routing if we're origin.
+ dest->Extend("operquit", new std::string(operreason));
parameterlist params;
- params.push_back(":"+reason);
+ params.push_back(":"+operreason);
Utils->DoOneToMany(dest->uuid,"OPERQUIT",params);
params.clear();
params.push_back(dest->uuid);
params.push_back(":"+reason);
- dest->SetOperQuit(operreason);
Utils->DoOneToMany(source->uuid,"KILL",params);
}
if (u)
{
- u->SetOperQuit(params[0]);
+ u->Extend("operquit", new std::string(params[0]));
params[0] = ":" + params[0];
Utils->DoOneToAllButSender(prefix,"OPERQUIT",params,prefix);
}
User* a = (User*)*n;
if (!IS_LOCAL(a))
{
+ if (this->Utils->quiet_bursts)
+ a->quietquit = true;
+
if (ServerInstance->Config->HideSplits)
ServerInstance->Users->QuitUser(a, "*.net *.split", reason_s);
else
ServerInstance->Users->QuitUser(a, reason_s);
-
- if (this->Utils->quiet_bursts)
- a->quietquit = true;
}
}
return time_to_die.size();
ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str());
user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str());
- user->quietquit = false;
- user->quitmsg = quitreason;
-
std::string reason;
std::string oper_reason;
reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
- if (!*operreason)
- {
- user->operquitmsg = quitreason;
- oper_reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
- }
- else
- {
- user->operquitmsg = operreason;
+ if (operreason && *operreason)
oper_reason.assign(operreason, 0, ServerInstance->Config->Limits.MaxQuit);
- }
+ else
+ oper_reason = quitreason;
ServerInstance->GlobalCulls.AddItem(user);
if (!user->quietquit)
{
ServerInstance->SNO->WriteToSnoMask('q',"Client exiting: %s!%s@%s [%s]",
- user->nick.c_str(), user->ident.c_str(), user->host.c_str(), user->operquitmsg.c_str());
+ user->nick.c_str(), user->ident.c_str(), user->host.c_str(), oper_reason.c_str());
}
}
else
if ((!ServerInstance->SilentULine(user->server)) && (!user->quietquit))
{
ServerInstance->SNO->WriteToSnoMask('Q',"Client exiting on server %s: %s!%s@%s [%s]",
- user->server, user->nick.c_str(), user->ident.c_str(), user->host.c_str(), user->operquitmsg.c_str());
+ user->server, user->nick.c_str(), user->ident.c_str(), user->host.c_str(), oper_reason.c_str());
}
}
user->AddToWhoWas();
}
}
-void User::SetOperQuit(const std::string &oquit)
-{
- operquitmsg = oquit;
-}
-
-const std::string& User::GetOperQuit()
-{
- return operquitmsg;
-}
-
void User::IncreasePenalty(int increase)
{
this->Penalty += increase;