From dea017b159f24701cf5e4b402b1e50bd63862352 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Apr 2004 13:41:17 +0000 Subject: Added support for module-based chanmodes with parameters and the ability to query the mode states. Created test case in m_testcommand module where a mode with one parameter can be set/removed on channels git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@375 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_testcommand.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 3b6b646a9..b65430c5a 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -55,7 +55,7 @@ class ModuleTestCommand : public Module Srv->AddCommand("WOOT",handle_woot,0,1); // Add a mode +Z for channels with no parameters - Srv->AddExtendedMode('Z',MT_CHANNEL,false,0,0); + Srv->AddExtendedMode('Z',MT_CHANNEL,false,1,0); } virtual bool OnExtendedMode(userrec* user, chanrec* chan, char modechar, int type, bool mode_on, string_list ¶ms) @@ -80,6 +80,16 @@ class ModuleTestCommand : public Module return 1; } + virtual void OnUserJoin(userrec* user, chanrec* channel) + { + Srv->Log(DEBUG,"OnUserJoin triggered"); + if (channel->IsCustomModeSet('Z')) + { + std::string param = channel->GetModeParameter('Z'); + Srv->Log(DEBUG,"Custom mode is set on this channel! Parameter="+param); + } + } + virtual ~ModuleTestCommand() { delete Srv; -- cgit v1.2.3