diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-16 01:17:09 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-16 01:17:09 +0000 |
commit | c71801ebc4577b19e604c0d91a95fdcfe5250cc9 (patch) | |
tree | 6abda63a0e80efb5c9cc27d98344e9571344ba88 /src/modules/m_cgiirc.cpp | |
parent | 6c5dc5e7b54edceb216a92463bf62387d0ab454b (diff) |
cgiirc: Pass hosts to WEBIRC command on rehash. No fucking wonder this never worked except on module load. _ARGH_. Thanks to Jeremy for his help in tracking this down.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11528 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cgiirc.cpp')
-rw-r--r-- | src/modules/m_cgiirc.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 39680d8b9..580060464 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -56,7 +56,7 @@ class CommandWebirc : public Command CGIHostlist Hosts; bool notify; public: - CommandWebirc(InspIRCd* Instance, CGIHostlist &cHosts, bool bnotify) : Command(Instance, "WEBIRC", 0, 4, true), Hosts(cHosts), notify(bnotify) + CommandWebirc(InspIRCd* Instance, bool bnotify) : Command(Instance, "WEBIRC", 0, 4, true), notify(bnotify) { this->source = "m_cgiirc.so"; this->syntax = "password client hostname ip"; @@ -86,6 +86,11 @@ class CommandWebirc : public Command ServerInstance->SNO->WriteGlobalSno('a', "Connecting user %s tried to use WEBIRC, but didn't match any configured webirc blocks.", user->GetFullRealHost().c_str()); return CMD_FAILURE; } + + void SetHosts(CGIHostlist &phosts) + { + this->Hosts = phosts; + } }; @@ -141,9 +146,8 @@ class ModuleCgiIRC : public Module public: ModuleCgiIRC(InspIRCd* Me) : Module(Me) { - + mycommand = new CommandWebirc(Me, NotifyOpers); OnRehash(NULL); - mycommand = new CommandWebirc(Me, Hosts, NotifyOpers); ServerInstance->AddCommand(mycommand); Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnCleanup, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect }; @@ -203,6 +207,8 @@ public: continue; } } + + mycommand->SetHosts(Hosts); } virtual void OnCleanup(int target_type, void* item) |