summaryrefslogtreecommitdiff
path: root/src/modules/m_spy.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-28 00:13:41 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-28 00:13:41 +0000
commitdc8f5d02f77aeabefaefe88005b99c8b47030ab7 (patch)
tree89ce56baff165606f8c16036b0a8d65459d53cb1 /src/modules/m_spy.cpp
parent9a98d0858bd71afa6c6cfb14fcbc030f7951fd12 (diff)
Add support for syntax of commands in place of the text 'Not enough parameters' in numeric 461, where supported.
To support this each derived class of command_t must set the value of command_t::syntax to a non-empty string. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4561 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spy.cpp')
-rw-r--r--src/modules/m_spy.cpp64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp
index 3e0e21a96..d6f6826a9 100644
--- a/src/modules/m_spy.cpp
+++ b/src/modules/m_spy.cpp
@@ -90,6 +90,7 @@ class cmd_spylist : public command_t
cmd_spylist () : command_t("SPYLIST", 'o', 0)
{
this->source = "m_spy.so";
+ syntax = "";
}
void Handle (const char** parameters, int pcnt, userrec *user)
@@ -107,37 +108,38 @@ class cmd_spylist : public command_t
class cmd_spynames : public command_t
{
public:
- cmd_spynames () : command_t("SPYNAMES", 'o', 0)
- {
- this->source = "m_spy.so";
- }
-
- void Handle (const char** parameters, int pcnt, userrec *user)
- {
- chanrec* c;
-
- if (!pcnt)
- {
- WriteServ(user->fd,"366 %s * :End of /NAMES list.",user->nick);
- return;
- }
-
- if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 1))
- return;
-
- WriteOpers("*** Oper %s used SPYNAMES to view the users on %s",user->nick,parameters[0]);
-
- c = FindChan(parameters[0]);
- if (c)
- {
- spy_userlist(user,c);
- WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, c->name);
- }
- else
- {
- WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
- }
- }
+ cmd_spynames () : command_t("SPYNAMES", 'o', 0)
+ {
+ this->source = "m_spy.so";
+ syntax = "{<channel>{,<channel>}}";
+ }
+
+ void Handle (const char** parameters, int pcnt, userrec *user)
+ {
+ chanrec* c;
+
+ if (!pcnt)
+ {
+ WriteServ(user->fd,"366 %s * :End of /NAMES list.",user->nick);
+ return;
+ }
+
+ if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 1))
+ return;
+
+ WriteOpers("*** Oper %s used SPYNAMES to view the users on %s",user->nick,parameters[0]);
+
+ c = FindChan(parameters[0]);
+ if (c)
+ {
+ spy_userlist(user,c);
+ WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, c->name);
+ }
+ else
+ {
+ WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]);
+ }
+ }
};
class ModuleSpy : public Module