mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
delserver: Allow selecting the server more exactly
Before this you could only give the hostname of a server and delserver would delete the first server with that hostname. Now you can also specify port and password to select the server to remove more exactly. One can't specify the ssl flag for delserver since this would be a little ugly, but since you can't do ssl/plain-text on the same port anyway this shouldn't be a big problem. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1640 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -329,9 +329,11 @@ void CClient::UserCommand(CString& sLine) {
|
||||
}
|
||||
} else if (sCommand.Equals("REMSERVER") || sCommand.Equals("DELSERVER")) {
|
||||
CString sServer = sLine.Token(1);
|
||||
unsigned short uPort = sLine.Token(2).ToUShort();
|
||||
CString sPass = sLine.Token(3);
|
||||
|
||||
if (sServer.empty()) {
|
||||
PutStatus("Usage: RemServer <host>");
|
||||
PutStatus("Usage: RemServer <host> [port] [pass]");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -340,7 +342,7 @@ void CClient::UserCommand(CString& sLine) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pUser->DelServer(sServer)) {
|
||||
if (m_pUser->DelServer(sServer, uPort, sPass)) {
|
||||
PutStatus("Server removed");
|
||||
} else {
|
||||
PutStatus("No such server");
|
||||
|
||||
Reference in New Issue
Block a user