diff --git a/modules/extra/away.cpp b/modules/extra/away.cpp index 175a0c07..0f939d05 100644 --- a/modules/extra/away.cpp +++ b/modules/extra/away.cpp @@ -11,6 +11,7 @@ #define REQUIRESSL +#include "Client.h" #include "User.h" #include "FileUtils.h" #include @@ -57,6 +58,15 @@ class CAway : public CModule PutModule(m_vMessages[a]); } + void ReplayCommand(const CString& sCommand) { + CString nick = GetClient()->GetNick(); + for (u_int a = 0; a < m_vMessages.size(); a++) { + CString sWhom = m_vMessages[a].Token(1, false, ":"); + CString sMessage = m_vMessages[a].Token(2, true, ":"); + PutUser(":" + sWhom + " PRIVMSG " + nick + " :" + sMessage); + } + } + void DeleteCommand(const CString& sCommand) { CString sWhich = sCommand.Token(1); if (sWhich == "all") { @@ -188,6 +198,7 @@ public: AddCommand("Ping", static_cast(&CAway::PingCommand)); AddCommand("Pass", static_cast(&CAway::PassCommand)); AddCommand("Show", static_cast(&CAway::ShowCommand)); + AddCommand("Replay", static_cast(&CAway::ReplayCommand)); AddCommand("EnableTimer", static_cast(&CAway::EnableTimerCommand)); AddCommand("DisableTimer", static_cast(&CAway::DisableTimerCommand)); AddCommand("SetTimer", static_cast(&CAway::SetTimerCommand),