diff --git a/IRCSock.cpp b/IRCSock.cpp index cced6528..1609497c 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -37,7 +37,7 @@ CIRCSock::~CIRCSock() { m_pZNC->ReleaseISpoof(); } - PutServ("QUIT :"); + PutServ("QUIT :" + m_pUser->GetQuitMsg()); m_msChans.clear(); } diff --git a/User.cpp b/User.cpp index 1ea51ad5..cf71fdb4 100644 --- a/User.cpp +++ b/User.cpp @@ -377,6 +377,7 @@ void CUser::SetDenyLoadMod(bool b) { m_bDenyLoadMod = b; } void CUser::SetDefaultChanModes(const string& s) { m_sDefaultChanModes = s; } void CUser::SetIRCNick(const CNick& n) { m_IRCNick = n; } void CUser::SetIRCServer(const string& s) { m_sIRCServer = s; } +void CUser::SetQuitMsg(const string& s) { m_sQuitMsg = s; } bool CUser::SetStatusPrefix(const string& s) { if ((!s.empty()) && (s.length() < 6) && (s.find(' ') == string::npos)) { @@ -412,4 +413,5 @@ const string& CUser::GetDefaultChanModes() const { return m_sDefaultChanModes; } const vector& CUser::GetChans() const { return m_vChans; } const CNick& CUser::GetIRCNick() const { return m_IRCNick; } const string& CUser::GetIRCServer() const { return m_sIRCServer; } +const string& CUser::GetQuitMsg() const { return m_sQuitMsg; } // !Getters diff --git a/User.h b/User.h index b5200d4c..e0fe1ccd 100644 --- a/User.h +++ b/User.h @@ -69,6 +69,7 @@ public: void SetDefaultChanModes(const string& s); void SetIRCNick(const CNick& n); void SetIRCServer(const string& s); + void SetQuitMsg(const string& s); // !Setters // Getters @@ -99,6 +100,7 @@ public: const vector& GetChans() const; const CNick& GetIRCNick() const; const string& GetIRCServer() const; + const string& GetQuitMsg() const; // !Getters private: protected: @@ -115,6 +117,7 @@ protected: string m_sDefaultChanModes; CNick m_IRCNick; string m_sIRCServer; + string m_sQuitMsg; bool m_bPassHashed; bool m_bUseClientIP; diff --git a/UserSock.cpp b/UserSock.cpp index 000ec424..0165f460 100644 --- a/UserSock.cpp +++ b/UserSock.cpp @@ -454,6 +454,12 @@ void CUserSock::UserCommand(const string& sLine) { pChan->DetachUser(); } } else if (strcasecmp(sCommand.c_str(), "SHUTDOWN") == 0) { + string sQuitMsg = CUtils::Token(sLine, 1, true); + + if (!sQuitMsg.empty()) { + m_pUser->SetQuitMsg(sQuitMsg); + } + throw CException(CException::EX_Shutdown); } else if (strcasecmp(sCommand.c_str(), "JUMP") == 0) { if (m_pUser) { @@ -790,7 +796,7 @@ void CUserSock::HelpUser() { Table.AddRow(); Table.SetCell("Command", "ListNicks"); Table.SetCell("Arguments", "<#chan>"); Table.SetCell("Description", "List all nicks on a channel"); Table.AddRow(); Table.SetCell("Command", "Topics"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Show topics in all channels"); Table.AddRow(); Table.SetCell("Command", "SetBuffer"); Table.SetCell("Arguments", "<#chan> [linecount]"); Table.SetCell("Description", "Set the buffer count for a channel"); - Table.AddRow(); Table.SetCell("Command", "Shutdown"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Shutdown znc completely"); + Table.AddRow(); Table.SetCell("Command", "Shutdown"); Table.SetCell("Arguments", "[message]"); Table.SetCell("Description", "Shutdown znc completely"); Table.AddRow(); Table.SetCell("Command", "Jump"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Jump to the next server in the list"); Table.AddRow(); Table.SetCell("Command", "Send"); Table.SetCell("Arguments", " "); Table.SetCell("Description", "Send a shell file to a nick on IRC"); Table.AddRow(); Table.SetCell("Command", "Get"); Table.SetCell("Arguments", ""); Table.SetCell("Description", "Send a shell file to yourself"); diff --git a/znc.conf b/znc.conf index 673ecd0d..fe734964 100644 --- a/znc.conf +++ b/znc.conf @@ -36,6 +36,7 @@ StatusPrefix = * Ident = znc RealName = Got ZNC? #VHost = uncomment.and.put.your.vhost.here.com + QuitMsg = ZNC by prozac - http://znc.sourceforge.net ChanModes = +stn KeepNick = true diff --git a/znc.cpp b/znc.cpp index 870eaebe..a7fb1cf2 100644 --- a/znc.cpp +++ b/znc.cpp @@ -370,6 +370,9 @@ bool CZNC::ParseConfig(const string& sConfigFile) { if (strcasecmp(sName.c_str(), "Nick") == 0) { pUser->SetNick(sValue); continue; + } else if (strcasecmp(sName.c_str(), "QuitMsg") == 0) { + pUser->SetQuitMsg(sValue); + continue; } else if (strcasecmp(sName.c_str(), "AltNick") == 0) { pUser->SetAltNick(sValue); continue;