Skip to content

Commit

Permalink
Add CLEARALLBUFFERS command (closes #852)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi committed Feb 23, 2015
1 parent 27d7879 commit 616690f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ClientCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,19 @@ void CClient::UserCommand(CString& sLine) {
m_pNetwork->DelQuery((*it)->GetName());
}
PutStatus("All query buffers have been cleared");
} else if (sCommand.Equals("CLEARALLBUFFERS")) {
if (!m_pNetwork) {
PutStatus("You must be connected with a network to use this command");
return;
}

for (CChan* pChan : m_pNetwork->GetChans()) {
pChan->ClearBuffer();
}
for (CQuery* pQuery : m_pNetwork->GetQueries()) {
m_pNetwork->DelQuery(pQuery->GetName());
}
PutStatus("All buffers have been cleared");
} else if (sCommand.Equals("SETBUFFER")) {
if (!m_pNetwork) {
PutStatus("You must be connected with a network to use this command");
Expand Down

2 comments on commit 616690f

@md-5
Copy link
Contributor

@md-5 md-5 commented on 616690f Feb 27, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given *alias is this really needed?

@Mikaela
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is somthing that should be there by default instead of having to have knowledge on how to add this in alias.

Please sign in to comment.