From 2370567f9c031591cb67a92c982e7075d4cb497d Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 9 Aug 2012 22:57:28 +0700 Subject: [PATCH] Don't show message about missing motd by default. To enable it, load missingmotd module. Fix #202 --- modules/missingmotd.cpp | 21 +++++++++++++++++++++ src/IRCNetwork.cpp | 2 -- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 modules/missingmotd.cpp 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) {