diff --git a/modules/missingmotd.cpp b/modules/missingmotd.cpp new file mode 100644 index 00000000..c6f0d810 --- /dev/null +++ b/modules/missingmotd.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2004-2012 See the AUTHORS file for details. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include + +class CMissingMotd : public CModule { +public: + MODCONSTRUCTOR(CMissingMotd) {} + + virtual void OnClientLogin() { + PutUser(":irc.znc.in 422 :MOTD File is missing"); + } +}; + +USERMODULEDEFS(CMissingMotd, "Sends 422 to clients when they login") + diff --git a/src/IRCNetwork.cpp b/src/IRCNetwork.cpp index 78eb9f23..d601b76d 100644 --- a/src/IRCNetwork.cpp +++ b/src/IRCNetwork.cpp @@ -473,8 +473,6 @@ void CIRCNetwork::ClientConnected(CClient *pClient) { for (uIdx = 0; uIdx < uSize; uIdx++) { pClient->PutClient(m_MotdBuffer.GetLine(uIdx, *pClient, msParams)); } - } else { - pClient->PutClient(":irc.znc.in 422 :MOTD Cache is missing"); } if (GetIRCSock() != NULL) {