-void User::ShowMOTD()
-{
- if (!ServerInstance->Config->MOTD.size())
- {
- this->WriteNumeric(422, "%s :Message of the day file is missing.",this->nick.c_str());
- return;
- }
- this->WriteNumeric(375, "%s :%s message of the day", this->nick.c_str(), ServerInstance->Config->ServerName);
-
- for (file_cache::iterator i = ServerInstance->Config->MOTD.begin(); i != ServerInstance->Config->MOTD.end(); i++)
- this->WriteNumeric(372, "%s :- %s",this->nick.c_str(),i->c_str());
-
- this->WriteNumeric(376, "%s :End of message of the day.", this->nick.c_str());
-}
-
-void User::ShowRULES()
-{
- if (!ServerInstance->Config->RULES.size())
- {
- this->WriteNumeric(434, "%s :RULES File is missing",this->nick.c_str());
- return;
- }
-
- this->WriteNumeric(308, "%s :- %s Server Rules -",this->nick.c_str(),ServerInstance->Config->ServerName);
-
- for (file_cache::iterator i = ServerInstance->Config->RULES.begin(); i != ServerInstance->Config->RULES.end(); i++)
- this->WriteNumeric(232, "%s :- %s",this->nick.c_str(),i->c_str());
-
- this->WriteNumeric(309, "%s :End of RULES command.",this->nick.c_str());
-}
-
-void User::HandleEvent(EventType et, int errornum)
-{
- if (this->quitting) // drop everything, user is due to be quit
- return;
-
- /* WARNING: May delete this user! */
- int thisfd = this->GetFd();
-
- try
- {
- switch (et)
- {
- case EVENT_READ:
- ServerInstance->ProcessUser(this);
- break;
- case EVENT_WRITE:
- this->FlushWriteBuf();
- break;
- case EVENT_ERROR:
- /** This should be safe, but dont DARE do anything after it -- Brain */
- this->SetWriteError(errornum ? strerror(errornum) : "EOF from client");
- break;
- }
- }
- catch (...)
- {
- ServerInstance->Logs->Log("USERS", DEBUG,"Exception in User::HandleEvent intercepted");
- }
-
- /* If the user has raised an error whilst being processed, quit them now we're safe to */
- if ((ServerInstance->SE->GetRef(thisfd) == this))
- {
- if (!WriteError.empty())
- {
- ServerInstance->Users->QuitUser(this, GetWriteError());
- }
- }
-}
-
-void User::SetOperQuit(const std::string &oquit)