From: <ps...@us...> - 2010-11-06 16:04:58
|
Revision: 2173 http://znc.svn.sourceforge.net/znc/?rev=2173&view=rev Author: psychon Date: 2010-11-06 16:04:51 +0000 (Sat, 06 Nov 2010) Log Message: ----------- Add a list of znc features to /znc version /znc version now also tells you something like this: <*status> IPv6: yes, SSL: yes, c-ares: yes Modified Paths: -------------- trunk/ClientCommand.cpp Modified: trunk/ClientCommand.cpp =================================================================== --- trunk/ClientCommand.cpp 2010-11-06 15:51:58 UTC (rev 2172) +++ trunk/ClientCommand.cpp 2010-11-06 16:04:51 UTC (rev 2173) @@ -106,7 +106,26 @@ PutStatus("Detaching you from [" + sChan + "]"); pChan->DetachUser(); } else if (sCommand.Equals("VERSION")) { + const char *features = "IPv6: " +#ifdef HAVE_IPV6 + "yes" +#else + "no" +#endif + ", SSL: " +#ifdef HAVE_LIBSSL + "yes" +#else + "no" +#endif + ", c-ares: " +#ifdef HAVE_C_ARES + "yes"; +#else + "no"; +#endif PutStatus(CZNC::GetTag()); + PutStatus(features); } else if (sCommand.Equals("MOTD") || sCommand.Equals("ShowMOTD")) { if (!SendMotd()) { PutStatus("There is no MOTD set."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ps...@us...> - 2011-01-26 23:07:17
|
Revision: 2275 http://znc.svn.sourceforge.net/znc/?rev=2275&view=rev Author: psychon Date: 2011-01-26 16:58:17 +0000 (Wed, 26 Jan 2011) Log Message: ----------- Accept wildcards for DetachChan, EnableChan, ClearBuffer and SetBuffer Modified Paths: -------------- trunk/ClientCommand.cpp Modified: trunk/ClientCommand.cpp =================================================================== --- trunk/ClientCommand.cpp 2011-01-24 18:22:43 UTC (rev 2274) +++ trunk/ClientCommand.cpp 2011-01-26 16:58:17 UTC (rev 2275) @@ -97,14 +97,22 @@ return; } - CChan* pChan = m_pUser->FindChan(sChan); - if (!pChan) { - PutStatus("You are not on [" + sChan + "]"); - return; + const vector<CChan*>& vChans = m_pUser->GetChans(); + vector<CChan*>::const_iterator it; + unsigned int uMatches = 0, uDetached = 0; + for (it = vChans.begin(); it != vChans.end(); ++it) { + if (!(*it)->GetName().WildCmp(sChan)) + continue; + uMatches++; + + if (!(*it)->IsDetached()) + continue; + uDetached++; + (*it)->DetachUser(); } - PutStatus("Detaching you from [" + sChan + "]"); - pChan->DetachUser(); + PutStatus("There were [" + CString(uMatches) + "] channels matching [" + sChan + "]"); + PutStatus("Detached [" + CString(uDetached) + "] channels"); } else if (sCommand.Equals("VERSION")) { const char *features = "IPv6: " #ifdef HAVE_IPV6 @@ -306,14 +314,22 @@ if (sChan.empty()) { PutStatus("Usage: EnableChan <channel>"); } else { - CChan* pChan = m_pUser->FindChan(sChan); - if (!pChan) { - PutStatus("Channel [" + sChan + "] not found."); - return; + const vector<CChan*>& vChans = m_pUser->GetChans(); + vector<CChan*>::const_iterator it; + unsigned int uMatches = 0, uEnabled = 0; + for (it = vChans.begin(); it != vChans.end(); ++it) { + if (!(*it)->GetName().WildCmp(sChan)) + continue; + uMatches++; + + if (!(*it)->IsDisabled()) + continue; + uEnabled++; + (*it)->Enable(); } - pChan->Enable(); - PutStatus("Channel [" + sChan + "] enabled."); + PutStatus("There were [" + CString(uMatches) + "] channels matching [" + sChan + "]"); + PutStatus("Enabled [" + CString(uEnabled) + "] channels"); } } else if (sCommand.Equals("LISTCHANS")) { CUser* pUser = m_pUser; @@ -931,13 +947,17 @@ return; } - if (!pChan->IsOn()) { - PutStatus("You are not on [" + sChan + "] [trying]"); - return; + const vector<CChan*>& vChans = m_pUser->GetChans(); + vector<CChan*>::const_iterator it; + unsigned int uMatches = 0; + for (it = vChans.begin(); it != vChans.end(); ++it) { + if (!(*it)->GetName().WildCmp(sChan)) + continue; + uMatches++; + + (*it)->ClearBuffer(); } - - pChan->ClearBuffer(); - PutStatus("The buffer for [" + sChan + "] has been cleared"); + PutStatus("The buffer for [" + CString(uMatches) + "] channels matching [" + sChan + "] has been cleared"); } else if (sCommand.Equals("CLEARALLCHANNELBUFFERS")) { vector<CChan*>::const_iterator it; const vector<CChan*>& vChans = m_pUser->GetChans(); @@ -954,21 +974,25 @@ return; } - CChan* pChan = m_pUser->FindChan(sChan); + unsigned int uLineCount = sLine.Token(2).ToUInt(); - if (!pChan) { - PutStatus("You are not on [" + sChan + "]"); - return; + const vector<CChan*>& vChans = m_pUser->GetChans(); + vector<CChan*>::const_iterator it; + unsigned int uMatches = 0, uFail = 0; + for (it = vChans.begin(); it != vChans.end(); ++it) { + if (!(*it)->GetName().WildCmp(sChan)) + continue; + uMatches++; + + if (!(*it)->SetBufferCount(uLineCount)) + uFail++; } - - unsigned int uLineCount = sLine.Token(2).ToUInt(); - - if (pChan->SetBufferCount(uLineCount)) { - PutStatus("BufferCount for [" + sChan + "] set to [" + CString(pChan->GetBufferCount()) + "]"); - } else { - PutStatus("Setting the buffer count failed, max buffer count is " - + CString(CZNC::Get().GetMaxBufferSize())); + PutStatus("BufferCount for [" + CString(uMatches - uFail) + + "] channels was set to [" + CString(uLineCount) + "]"); + if (uFail > 0) { + PutStatus("Setting BufferCount failed for [" + CString(uFail) + "] channels, " + "max buffer count is " + CString(CZNC::Get().GetMaxBufferSize())); } } else if (m_pUser->IsAdmin() && sCommand.Equals("TRAFFIC")) { CZNC::TrafficStatsPair Users, ZNC, Total; @@ -1122,6 +1146,9 @@ Table.AddColumn("Arguments"); Table.AddColumn("Description"); + PutStatus("In the following list all occurences of <#chan> support wildcards (* and ?)"); + PutStatus("(Except ListNicks)"); + Table.AddRow(); Table.SetCell("Command", "Version"); Table.SetCell("Description", "Print which version of ZNC this is"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sil...@us...> - 2011-02-05 15:51:13
|
Revision: 2277 http://znc.svn.sourceforge.net/znc/?rev=2277&view=rev Author: silverleo Date: 2011-02-05 15:51:07 +0000 (Sat, 05 Feb 2011) Log Message: ----------- psychon would say there's nothing to see here Modified Paths: -------------- trunk/ClientCommand.cpp Modified: trunk/ClientCommand.cpp =================================================================== --- trunk/ClientCommand.cpp 2011-02-02 13:14:22 UTC (rev 2276) +++ trunk/ClientCommand.cpp 2011-02-05 15:51:07 UTC (rev 2277) @@ -105,7 +105,7 @@ continue; uMatches++; - if (!(*it)->IsDetached()) + if ((*it)->IsDetached()) continue; uDetached++; (*it)->DetachUser(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |