mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
And fix a shitload of trailing whitespaces and space / tab mixups in ZNC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@959 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
88
Client.cpp
88
Client.cpp
@@ -145,7 +145,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
}
|
||||
} else if (sCommand.CaseCmp("PING") == 0) {
|
||||
CString sTarget = sLine.Token(1);
|
||||
|
||||
|
||||
if (sTarget.CaseCmp("irc.znc.com") == 0) {
|
||||
PutClient("PONG " + sLine.substr(5));
|
||||
return;
|
||||
@@ -646,7 +646,7 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
for (unsigned int b = 0; b < sPerms.size(); b++) {
|
||||
if (a->second->HasPerm(sPerms[b])) {
|
||||
CString sPerm;
|
||||
sPerm += sPerms[b];
|
||||
sPerm += sPerms[b];
|
||||
Table.SetCell(sPerm, sPerm);
|
||||
}
|
||||
}
|
||||
@@ -845,7 +845,7 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
PutStatus("Channel [" + sChan + "] not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
pChan->Enable();
|
||||
PutStatus("Channel [" + sChan + "] enabled.");
|
||||
}
|
||||
@@ -1416,50 +1416,50 @@ void CClient::UserCommand(const CString& sLine) {
|
||||
pChan->SetBufferCount(uLineCount);
|
||||
|
||||
PutStatus("BufferCount for [" + sChan + "] set to [" + CString(pChan->GetBufferCount()) + "]");
|
||||
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("TRAFFIC") == 0) {
|
||||
CZNC::Get().UpdateTrafficStats();
|
||||
const map<CString, CUser*>& msUsers = CZNC::Get().GetUserMap();
|
||||
CTable Table;
|
||||
Table.AddColumn("Username");
|
||||
Table.AddColumn("In");
|
||||
Table.AddColumn("Out");
|
||||
Table.AddColumn("Total");
|
||||
unsigned long long users_total_in = 0;
|
||||
unsigned long long users_total_out = 0;
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", it->first);
|
||||
Table.SetCell("In", CString(it->second->BytesRead()));
|
||||
Table.SetCell("Out", CString(it->second->BytesWritten()));
|
||||
Table.SetCell("Total", CString(it->second->BytesRead() + it->second->BytesWritten()));
|
||||
users_total_in += it->second->BytesRead();
|
||||
users_total_out += it->second->BytesWritten();
|
||||
}
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<Users>");
|
||||
Table.SetCell("In", CString(users_total_in));
|
||||
Table.SetCell("Out", CString(users_total_out));
|
||||
Table.SetCell("Total", CString(users_total_in + users_total_out));
|
||||
} else if (m_pUser->IsAdmin() && sCommand.CaseCmp("TRAFFIC") == 0) {
|
||||
CZNC::Get().UpdateTrafficStats();
|
||||
const map<CString, CUser*>& msUsers = CZNC::Get().GetUserMap();
|
||||
CTable Table;
|
||||
Table.AddColumn("Username");
|
||||
Table.AddColumn("In");
|
||||
Table.AddColumn("Out");
|
||||
Table.AddColumn("Total");
|
||||
unsigned long long users_total_in = 0;
|
||||
unsigned long long users_total_out = 0;
|
||||
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); it++) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", it->first);
|
||||
Table.SetCell("In", CString(it->second->BytesRead()));
|
||||
Table.SetCell("Out", CString(it->second->BytesWritten()));
|
||||
Table.SetCell("Total", CString(it->second->BytesRead() + it->second->BytesWritten()));
|
||||
users_total_in += it->second->BytesRead();
|
||||
users_total_out += it->second->BytesWritten();
|
||||
}
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<Users>");
|
||||
Table.SetCell("In", CString(users_total_in));
|
||||
Table.SetCell("Out", CString(users_total_out));
|
||||
Table.SetCell("Total", CString(users_total_in + users_total_out));
|
||||
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<ZNC>");
|
||||
Table.SetCell("In", CString(CZNC::Get().BytesRead()));
|
||||
Table.SetCell("Out", CString(CZNC::Get().BytesWritten()));
|
||||
Table.SetCell("Total", CString(CZNC::Get().BytesRead() + CZNC::Get().BytesWritten()));
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<ZNC>");
|
||||
Table.SetCell("In", CString(CZNC::Get().BytesRead()));
|
||||
Table.SetCell("Out", CString(CZNC::Get().BytesWritten()));
|
||||
Table.SetCell("Total", CString(CZNC::Get().BytesRead() + CZNC::Get().BytesWritten()));
|
||||
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<Total>");
|
||||
Table.SetCell("In", CString(users_total_in + CZNC::Get().BytesRead()));
|
||||
Table.SetCell("Out", CString(users_total_out + CZNC::Get().BytesWritten()));
|
||||
Table.SetCell("Total", CString(users_total_in + CZNC::Get().BytesRead() + users_total_out + CZNC::Get().BytesWritten()));
|
||||
Table.AddRow();
|
||||
Table.SetCell("Username", "<Total>");
|
||||
Table.SetCell("In", CString(users_total_in + CZNC::Get().BytesRead()));
|
||||
Table.SetCell("Out", CString(users_total_out + CZNC::Get().BytesWritten()));
|
||||
Table.SetCell("Total", CString(users_total_in + CZNC::Get().BytesRead() + users_total_out + CZNC::Get().BytesWritten()));
|
||||
|
||||
if (Table.size()) {
|
||||
unsigned int uTableIdx = 0;
|
||||
CString sLine;
|
||||
while (Table.GetLine(uTableIdx++, sLine)) {
|
||||
PutStatus(sLine);
|
||||
}
|
||||
}
|
||||
if (Table.size()) {
|
||||
unsigned int uTableIdx = 0;
|
||||
CString sLine;
|
||||
while (Table.GetLine(uTableIdx++, sLine)) {
|
||||
PutStatus(sLine);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
PutStatus("Unknown command [" + sCommand + "] try 'Help'");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user