merge rev 962;965;972-975:

- increased select timeout to 0.5 secs (this should save CPU time)
- added real-life ISpoof example to the example znc.conf
- make away module ignore message from the user (fixes antiidle together with away)
- show error message when webadmin cant bind to a port (improved later)
- fix /me, it was turned into a CTCP
- remove an extra space


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@802 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2007-05-16 22:35:17 +00:00
parent 1fa9187be6
commit d82eb75d1c
5 changed files with 23 additions and 13 deletions
+9 -8
View File
@@ -687,12 +687,12 @@ bool CIRCSock::OnCTCPReply(CNick& Nick, CString& sMessage) {
}
bool CIRCSock::OnPrivCTCP(CNick& Nick, CString& sMessage) {
if (sMessage.Token(0).CaseCmp("ACTION") == 0) {
sMessage = sMessage.Token(1, true);
if (sMessage.Left(7).CaseCmp("ACTION ") == 0) {
sMessage = sMessage.substr(7);
MODULECALL(OnPrivAction(Nick, sMessage), m_pUser, NULL, return true);
} else {
MODULECALL(OnPrivCTCP(Nick, sMessage), m_pUser, NULL, return true);
sMessage = "ACTION " + sMessage;
}
MODULECALL(OnPrivCTCP(Nick, sMessage), m_pUser, NULL, return true);
if (strncasecmp(sMessage.c_str(), "DCC ", 4) == 0 && m_pUser && m_pUser->BounceDCCs() && m_pUser->IsUserAttached()) {
// DCC CHAT chat 2453612361 44592
@@ -794,14 +794,15 @@ bool CIRCSock::OnChanCTCP(CNick& Nick, const CString& sChan, CString& sMessage)
CChan* pChan = m_pUser->FindChan(sChan);
if (pChan) {
// Record a /me
if (sMessage.Token(0).CaseCmp("ACTION") == 0) {
if (sMessage.Left(7).CaseCmp("ACTION ") == 0) {
sMessage = sMessage.substr(7);
if(pChan->KeepBuffer() || !m_pUser->IsUserAttached()) {
pChan->AddBuffer(":" + Nick.GetNickMask() + " PRIVMSG " + sChan + " :\001ACTION " + m_pUser->AddTimestamp(sMessage.Token(1, true)) + "\001");
pChan->AddBuffer(":" + Nick.GetNickMask() + " PRIVMSG " + sChan + " :\001ACTION " + m_pUser->AddTimestamp(sMessage) + "\001");
}
MODULECALL(OnChanAction(Nick, *pChan, sMessage), m_pUser, NULL, return true);
} else {
MODULECALL(OnChanCTCP(Nick, *pChan, sMessage), m_pUser, NULL, return true);
sMessage = "ACTION " + sMessage;
}
MODULECALL(OnChanCTCP(Nick, *pChan, sMessage), m_pUser, NULL, return true);
}
return (pChan && pChan->IsDetached());
+2
View File
@@ -484,6 +484,8 @@ private:
void AddMessage( time_t iTime, const CNick & Nick, CString & sMessage )
{
if (m_pUser && Nick.GetNick() == m_pUser->GetIRCNick().GetNick())
return; // ignore messages from self
AddMessage( CString( iTime ) + ":" + Nick.GetNickMask() + ":" + sMessage );
}
+6 -1
View File
@@ -163,7 +163,12 @@ public:
}
#endif
return m_pManager->ListenHost(m_uPort, "WebAdmin::Listener", m_sListenHost, bSSL, SOMAXCONN, pListenSock, 0, bIPv6);
bool b = m_pManager->ListenHost(m_uPort, "WebAdmin::Listener", m_sListenHost, bSSL, SOMAXCONN, pListenSock, 0, bIPv6);
if (!b) {
printf("\n"); // dont mix it up with the 'loading module' message
CUtils::PrintMessage("Error: " + CString(strerror(errno)), true);
}
return b;
}
void AddSock(CWebAdminSock* pSock) {
+4 -2
View File
@@ -8,8 +8,10 @@
// If the port is prepended with a '+' then znc listens using ssl. Note: znc must be compiled with ssl enabled.
ListenPort = 12345
// If you define the ISpoofFile, znc will write the ident of the user trying to connect to the file. Very useful if your box supports oidentd.
#ISpoofFile = /tmp/ispoof
// If you define the ISpoofFile, znc will write the ident of the user trying to connect to the file.
// This example is for oidentd:
#ISpoofFile = /home/<user>/.oidentd.conf
#ISpoofFormat = global { reply "%" }
// This is the pid file that is needed if you want to crontab the zncchk shell script
PidFile = znc.pid
+2 -2
View File
@@ -59,7 +59,7 @@ CString CZNC::GetTag(bool bIncludeVersion) {
char szBuf[128];
memset(szBuf, 0, 128);
snprintf(szBuf, 127, "ZNC %1.3f by prozac - http://znc.sourceforge.net", VERSION);
snprintf(szBuf, 127, "ZNC %1.3f by prozac - http://znc.sourceforge.net", VERSION);
return szBuf;
}
@@ -81,7 +81,7 @@ bool CZNC::OnBoot() {
}
int CZNC::Loop() {
m_Manager.SetSelectTimeout(10000);
m_Manager.SetSelectTimeout(500000);
m_itUserIter = m_msUsers.begin();
time_t tNextConnect = 0;