mirror of
https://github.com/znc/znc.git
synced 2026-05-07 22:04:46 +02:00
Simplify nickserv module.
Now alias module exists, so nickserv module doesn't need any custom command. It justs identifies user. Close #662
This commit is contained in:
@@ -43,44 +43,8 @@ public:
|
||||
DelNV("NickServName");
|
||||
}
|
||||
|
||||
void GhostCommand(const CString& sLine) {
|
||||
if (sLine.Token(1).empty()) {
|
||||
PutModule("Syntax: ghost <nickname>");
|
||||
} else {
|
||||
DoNickCommand("GhostCmd", sLine.Token(1));
|
||||
}
|
||||
}
|
||||
|
||||
void RecoverCommand(const CString& sLine) {
|
||||
if (sLine.Token(1).empty()) {
|
||||
PutModule("Syntax: recover <nickname>");
|
||||
} else {
|
||||
DoNickCommand("RecoverCmd", sLine.Token(1));
|
||||
}
|
||||
}
|
||||
|
||||
void ReleaseCommand(const CString& sLine) {
|
||||
if (sLine.Token(1).empty()) {
|
||||
PutModule("Syntax: release <nickname>");
|
||||
} else {
|
||||
DoNickCommand("ReleaseCmd", sLine.Token(1));
|
||||
}
|
||||
}
|
||||
|
||||
void GroupCommand(const CString& sLine) {
|
||||
if (sLine.Token(1).empty()) {
|
||||
PutModule("Syntax: group <nickname>");
|
||||
} else {
|
||||
DoNickCommand("GroupCmd", sLine.Token(1));
|
||||
}
|
||||
}
|
||||
|
||||
void ViewCommandsCommand(const CString& sLine) {
|
||||
PutModule("IDENTIFY " + GetNV("IdentifyCmd"));
|
||||
PutModule("GHOST " + GetNV("GhostCmd"));
|
||||
PutModule("RECOVER " + GetNV("RecoverCmd"));
|
||||
PutModule("RELEASE " + GetNV("ReleaseCmd"));
|
||||
PutModule("GROUP " + GetNV("GroupCmd"));
|
||||
}
|
||||
|
||||
void SetCommandCommand(const CString& sLine) {
|
||||
@@ -88,14 +52,6 @@ public:
|
||||
CString sNewCmd = sLine.Token(2, true);
|
||||
if (sCmd.Equals("IDENTIFY")) {
|
||||
SetNV("IdentifyCmd", sNewCmd);
|
||||
} else if (sCmd.Equals("GHOST")) {
|
||||
SetNV("GhostCmd", sNewCmd);
|
||||
} else if (sCmd.Equals("RECOVER")) {
|
||||
SetNV("RecoverCmd", sNewCmd);
|
||||
} else if (sCmd.Equals("RELEASE")) {
|
||||
SetNV("ReleaseCmd", sNewCmd);
|
||||
} else if (sCmd.Equals("GROUP")) {
|
||||
SetNV("GroupCmd", sNewCmd);
|
||||
} else {
|
||||
PutModule("No such editable command. See ViewCommands for list.");
|
||||
return;
|
||||
@@ -113,14 +69,6 @@ public:
|
||||
"nickname", "Set NickServ name (Useful on networks like EpiKnet, where NickServ is named Themis)");
|
||||
AddCommand("ClearNSName", static_cast<CModCommand::ModCmdFunc>(&CNickServ::ClearNSNameCommand),
|
||||
"", "Reset NickServ name to default (NickServ)");
|
||||
AddCommand("Ghost", static_cast<CModCommand::ModCmdFunc>(&CNickServ::GhostCommand),
|
||||
"nickname", "GHOST disconnects an old user session, or somebody attempting to use your nickname without authorization.");
|
||||
AddCommand("Recover", static_cast<CModCommand::ModCmdFunc>(&CNickServ::RecoverCommand),
|
||||
"nickname");
|
||||
AddCommand("Release", static_cast<CModCommand::ModCmdFunc>(&CNickServ::ReleaseCommand),
|
||||
"nickname");
|
||||
AddCommand("Group", static_cast<CModCommand::ModCmdFunc>(&CNickServ::GroupCommand),
|
||||
"nickname");
|
||||
AddCommand("ViewCommands", static_cast<CModCommand::ModCmdFunc>(&CNickServ::ViewCommandsCommand),
|
||||
"", "Show patterns for lines, which are being sent to NickServ");
|
||||
AddCommand("SetCommand", static_cast<CModCommand::ModCmdFunc>(&CNickServ::SetCommandCommand),
|
||||
@@ -138,18 +86,6 @@ public:
|
||||
if (GetNV("IdentifyCmd").empty()) {
|
||||
SetNV("IdentifyCmd", "PRIVMSG NickServ :IDENTIFY {password}");
|
||||
}
|
||||
if (GetNV("GhostCmd").empty()) {
|
||||
SetNV("GhostCmd", "PRIVMSG NickServ :GHOST {nickname} {password}");
|
||||
}
|
||||
if (GetNV("RecoverCmd").empty()) {
|
||||
SetNV("RecoverCmd", "PRIVMSG NickServ :RECOVER {nickname} {password}");
|
||||
}
|
||||
if (GetNV("ReleaseCmd").empty()) {
|
||||
SetNV("ReleaseCmd", "PRIVMSG NickServ :RELEASE {nickname} {password}");
|
||||
}
|
||||
if (GetNV("GroupCmd").empty()) {
|
||||
SetNV("GroupCmd", "PRIVMSG NickServ :GROUP {nickname} {password}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user