* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
#include "channels.h"
#include "modules.h"
-Server *Srv;
+static Server *Srv;
class cmd_samode : public command_t
{
cmd_samode () : command_t("SAMODE", 'o', 2)
{
this->source = "m_samode.so";
+ syntax = "<target> <modes> {<mode-parameters>}";
}
- void Handle (char **parameters, int pcnt, userrec *user)
+ void Handle (const char** parameters, int pcnt, userrec *user)
{
/*
* Handles an SAMODE request. Notifies all +s users.
*/
- int n=0;
std::string result;
Srv->Log(DEBUG,"SAMODE: Being handled");
- Srv->SendMode(parameters,pcnt,user);
+ userrec* n = new userrec();
+ n->fd = FD_MAGIC_NUMBER;
+ Srv->SendMode(parameters,pcnt,n);
+ delete n;
Srv->Log(DEBUG,"SAMODE: Modechange handled");
- result = std::string(user->nick) + std::string(" used SAMODE ");
- while (n<pcnt)
+ result = std::string(user->nick);
+ result.append(" used SAMODE");
+ for (int n = 0; n < pcnt; n++)
{
- result=result + std::string(" ") + std::string(parameters[n]);
- n++;
+ result.append(" ");
+ result.append(parameters[n]);
}
Srv->SendOpers(result);
}
{
return Version(1,0,2,2,VF_VENDOR);
}
-
- virtual void OnUserConnect(userrec* user)
- {
- }
-
};