X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_watch.cpp;h=5b911632c580df557a1c71a87145c08f3bb86515;hb=66098d307c036997e51eaea21724615e27fdc3e9;hp=2ba9c9afb1bc1c2964be5d830d55a85d9c3013d5;hpb=54546ce8b8ca863eb3f4024094cf012500d68683;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 2ba9c9afb..5b911632c 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -28,7 +28,8 @@ using namespace std; /* $ModDesc: Provides support for the /watch command */ -static Server *Srv; + +extern InspIRCd* ServerInstance; class watchentry : public classbase { @@ -43,7 +44,7 @@ watchlist watches; 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]|[+|-]"; @@ -58,7 +59,7 @@ class cmd_watch : public command_t 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); @@ -99,7 +100,7 @@ class cmd_watch : public command_t 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); @@ -136,7 +137,7 @@ class cmd_watch : public command_t 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); @@ -180,7 +181,7 @@ class cmd_watch : public command_t 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); @@ -201,12 +202,12 @@ class Modulewatch : public Module 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) @@ -314,7 +315,7 @@ class ModulewatchFactory : public ModuleFactory { } - virtual Module * CreateModule(Server* Me) + virtual Module * CreateModule(InspIRCd* Me) { return new Modulewatch(Me); }