summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_nonicks.cpp2
-rw-r--r--src/modules/m_seenicks.cpp78
2 files changed, 79 insertions, 1 deletions
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 403bf5abb..0532519a2 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -18,7 +18,7 @@
#include "configreader.h"
#include "inspircd.h"
-/* $ModDesc: Provides support for unreal-style GLOBOPS and umode +g */
+/* $ModDesc: Provides support for channel mode +N which prevents nick changes on channel */
class NoNicks : public ModeHandler
{
diff --git a/src/modules/m_seenicks.cpp b/src/modules/m_seenicks.cpp
new file mode 100644
index 000000000..2e632a5ba
--- /dev/null
+++ b/src/modules/m_seenicks.cpp
@@ -0,0 +1,78 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+#include "hashcomp.h"
+#include "configreader.h"
+#include "inspircd.h"
+
+/* $ModDesc: Provides support for seeing local and remote nickchanges via snomasks */
+
+class ModuleSeeNicks : public Module
+{
+ public:
+ ModuleSeeNicks(InspIRCd* Me)
+ : Module::Module(Me)
+ {
+ ServerInstance->SNO->EnableSnomask('n',"NICK");
+ ServerInstance->SNO->EnableSnomask('N',"REMOTENICK");
+ }
+
+ virtual ~ModuleSeeNicks()
+ {
+ ServerInstance->SNO->DisableSnomask('n');
+ ServerInstance->SNO->DisableSnomask('N');
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1,1,0,1, VF_VENDOR, API_VERSION);
+ }
+
+ void Implements(char* List)
+ {
+ List[I_OnUserPostNick] = 1;
+ }
+
+ virtual void OnUserPostNick(userrec* user, const std::string &oldnick)
+ {
+ ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(user) ? 'n' : 'N',"User %s changed their nickname to %s", oldnick.c_str(), user->nick);
+ }
+};
+
+class ModuleSeeNicksFactory : public ModuleFactory
+{
+ public:
+ ModuleSeeNicksFactory()
+ {
+ }
+
+ ~ModuleSeeNicksFactory()
+ {
+ }
+
+ virtual Module * CreateModule(InspIRCd* Me)
+ {
+ return new ModuleSeeNicks(Me);
+ }
+
+};
+
+
+extern "C" void * init_module( void )
+{
+ return new ModuleSeeNicksFactory;
+}
+