diff --git a/ClientCommand.cpp b/ClientCommand.cpp index db4264cc..215c8848 100644 --- a/ClientCommand.cpp +++ b/ClientCommand.cpp @@ -249,7 +249,8 @@ void CClient::UserCommand(CString& sLine) { // to the IRC server was established. Before this we can // only find the IRC socket by its name. if (GetIRCSock()) { - GetIRCSock()->Quit(); + CString sQuitMsg = sLine.Token(1, true); + GetIRCSock()->Quit(sQuitMsg); } else { Csock* pIRCSock; CString sSockName = "IRC::" + m_pUser->GetUserName(); @@ -1190,6 +1191,7 @@ void CClient::HelpUser() { Table.AddRow(); Table.SetCell("Command", "Disconnect"); + Table.SetCell("Arguments", "[message]"); Table.SetCell("Description", "Disconnect from IRC"); Table.AddRow(); diff --git a/IRCSock.cpp b/IRCSock.cpp index 73236272..beebd139 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -63,8 +63,9 @@ CIRCSock::~CIRCSock() { GetUser()->AddBytesWritten(GetBytesWritten()); } -void CIRCSock::Quit() { - PutIRC("QUIT :" + m_pUser->GetQuitMsg()); +void CIRCSock::Quit(const CString& sQuitMsg) { + CString sMsg = (!sQuitMsg.empty()) ? sQuitMsg : m_pUser->GetQuitMsg(); + PutIRC("QUIT :" + sMsg); Close(CLT_AFTERWRITE); } diff --git a/IRCSock.h b/IRCSock.h index 9bad80a5..e8d9d275 100644 --- a/IRCSock.h +++ b/IRCSock.h @@ -51,7 +51,7 @@ public: void PutIRC(const CString& sLine); void ResetChans(); - void Quit(); + void Quit(const CString& sQuitMsg = ""); // Setters void SetPass(const CString& s) { m_sPass = s; }