summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_antibear.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp
new file mode 100644
index 000000000..ee595a767
--- /dev/null
+++ b/src/modules/m_antibear.cpp
@@ -0,0 +1,86 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
+ * E-mail:
+ * <brain@chatspike.net>
+ * <Craig@chatspike.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+using namespace std;
+
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+#include "helperfuncs.h"
+
+/* $ModDesc: Sends a numeric on connect which cripples a common type of trojan/spambot */
+
+class ModuleAntiBear : public Module
+{
+ private:
+
+ Server *Srv;
+ public:
+ ModuleAntiBear(Server* Me)
+ : Module::Module(Me)
+ {
+ Srv = Me;
+ }
+
+ virtual ~ModuleAntiBear()
+ {
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1,0,0,0,VF_VENDOR);
+ }
+
+ void Implements(char* List)
+ {
+ List[I_OnUserConnect] = 1;
+ }
+
+ virtual void OnUserConnect(userrec* user)
+ {
+ WriteServ(user,"439 %s :This server has anti-spambot mechanisms enabled.", user->nick);
+ }
+};
+
+class ModuleAntiBearFactory : public ModuleFactory
+{
+ public:
+ ModuleAntiBearFactory()
+ {
+ }
+
+ ~ModuleAntiBearFactory()
+ {
+ }
+
+ virtual Module * CreateModule(Server* Me)
+ {
+ return new ModuleAntiBear(Me);
+ }
+
+};
+
+
+//
+// The "C" linkage factory0() function creates the ModuleAntiBearFactory
+// class for this library
+//
+
+extern "C" void * init_module( void )
+{
+ return new ModuleAntiBearFactory;
+}
+