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
This commit is contained in:
psychon
2010-02-01 19:46:26 +00:00
parent c7546c0c05
commit 596fb7aec4

View File

@@ -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) {