From 945c4117279b9227dd47edf3f1ed2df6b6771d05 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 1 Feb 2010 19:46:26 +0000 Subject: [PATCH] Don't request the MOTD if there is none If a new client logs in and we don't have a MOTD cached, we request it via /motd. Since the IRC server sends it to use on connect anyway, there is no point in requesting it if there is none. (And even if there is no MOTD, we should get a "422 MOTD File is missing" which would be cached, so still no empty MOTD buffer) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1728 726aef4b-f618-498e-8847-2d620e286838 --- User.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/User.cpp b/User.cpp index 62b75684..5ec675ea 100644 --- a/User.cpp +++ b/User.cpp @@ -276,15 +276,11 @@ void CUser::UserConnected(CClient* pClient) { } // Send the cached MOTD - if (m_MotdBuffer.IsEmpty()) { - PutIRC("MOTD"); - } else { - unsigned int uIdx = 0; - CString sLine; + unsigned int uIdx = 0; + CString sLine; - while (m_MotdBuffer.GetLine(GetIRCNick().GetNick(), sLine, uIdx++)) { - pClient->PutClient(sLine); - } + while (m_MotdBuffer.GetLine(GetIRCNick().GetNick(), sLine, uIdx++)) { + pClient->PutClient(sLine); } if (GetIRCSock() != NULL) {