/* $ModDesc: Provides support for the /watch command */
-static Server *Srv;
+
+extern InspIRCd* ServerInstance;
class watchentry : public classbase
{
class cmd_watch : public command_t
{
public:
- cmd_watch() : command_t("WATCH",0,0)
+ cmd_watch (InspIRCd* Instance) : command_t(Instance,"WATCH",0,0)
{
this->source = "m_watch.so";
syntax = "[C|L|S]|[+|-<nick>]";
watchentry* a = (watchentry*)(*q);
if (a->watcher == user)
{
- userrec* targ = Srv->FindNick(a->target);
+ userrec* targ = ServerInstance->FindNick(a->target);
if (targ)
{
user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
watchentry* a = (watchentry*)(*q);
if (a->watcher == user)
{
- userrec* targ = Srv->FindNick(a->target);
+ userrec* targ = ServerInstance->FindNick(a->target);
if (targ)
{
user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,targ->nick,targ->ident,targ->dhost,targ->age);
if (b->watcher == user)
{
irc::string n2 = b->target.c_str();
- userrec* a = Srv->FindNick(b->target);
+ userrec* a = ServerInstance->FindNick(b->target);
if (a)
{
user->WriteServ("602 %s %s %s %s %lu :stopped watching",user->nick,a->nick,a->ident,a->dhost,a->age);
watches.push_back(w);
log(DEBUG,"*** Added %s to watchlist of %s",nick,user->nick);
}
- userrec* a = Srv->FindNick(nick);
+ userrec* a = ServerInstance->FindNick(nick);
if (a)
{
user->WriteServ("604 %s %s %s %s %lu :is online",user->nick,a->nick,a->ident,a->dhost,a->age);
cmd_watch* mycommand;
public:
- Modulewatch(Server* Me)
+ Modulewatch(InspIRCd* Me)
: Module::Module(Me)
{
- Srv = Me;
- mycommand = new cmd_watch();
- Srv->AddCommand(mycommand);
+
+ mycommand = new cmd_watch(ServerInstance);
+ ServerInstance->AddCommand(mycommand);
}
void Implements(char* List)
{
}
- virtual Module * CreateModule(Server* Me)
+ virtual Module * CreateModule(InspIRCd* Me)
{
return new Modulewatch(Me);
}