summaryrefslogtreecommitdiff
path: root/src/modules
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
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')
-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;
+}
+