summaryrefslogtreecommitdiff
path: root/src/modules/m_seenicks.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-01 18:00:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-01 18:00:18 +0000
commit6c6d83a21718b342c4f615dcca4093d06638f9fb (patch)
treeefb0eff5fa9d57fe2c187b5fd72d33d02fa44039 /src/modules/m_seenicks.cpp
parentd14267d0cc8a23efb6c2639da56f8c8e1ad90958 (diff)
Add m_seenicks.so, adds snomasks +nN which show local and remote nick changes (requested by giggsey, http://www.inspircd.org/forum/showthread.php?t=187)
Fix m_nonicks description to not say it's globops. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6725 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_seenicks.cpp')
-rw-r--r--src/modules/m_seenicks.cpp78
1 files changed, 78 insertions, 0 deletions
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;
+}
+