Merge pull request #1051 from ChasedSpade/controlpanel-syntax

ControlPanel: Move syntax of GetNetwork and SetNetwork
This commit is contained in:
Alexey Sokolov
2015-08-30 23:39:07 +01:00
+10 -10
View File
@@ -452,6 +452,11 @@ class CAdminMod : public CModule {
CIRCNetwork *pNetwork = nullptr;
if (sVar.empty()) {
PutModule("Usage: GetNetwork <variable> [username] [network]");
return;
}
if (sUsername.empty()) {
pNetwork = CModule::GetNetwork();
} else {
@@ -466,11 +471,6 @@ class CAdminMod : public CModule {
}
}
if (!pNetwork) {
PutModule("Usage: GetNetwork <variable> <username> <network>");
return;
}
if (sVar.Equals("nick")) {
PutModule("Nick = " + pNetwork->GetNick());
} else if (sVar.Equals("altnick")) {
@@ -507,6 +507,11 @@ class CAdminMod : public CModule {
CUser *pUser = nullptr;
CIRCNetwork *pNetwork = nullptr;
if (sValue.empty()) {
PutModule("Usage: SetNetwork <variable> <username> <network> <value>");
return;
}
if (sUsername.empty()) {
pUser = GetUser();
pNetwork = CModule::GetNetwork();
@@ -522,11 +527,6 @@ class CAdminMod : public CModule {
}
}
if (!pNetwork) {
PutModule("Usage: SetNetwork <variable> <username> <network> <value>");
return;
}
if (sVar.Equals("nick")) {
pNetwork->SetNick(sValue);
PutModule("Nick = " + pNetwork->GetNick());