summaryrefslogtreecommitdiff
path: root/src/modules/m_halfvoice.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-20 16:49:14 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-20 16:49:14 +0000
commit1b063c74b4f6437059a61f42f39ea8bb725e8cd8 (patch)
tree492cce31ea17b5504c2bf20b56d2e1553de9a377 /src/modules/m_halfvoice.cpp
parent4d46f5f9ef94c295649afad38c6d496ae2bbe5e1 (diff)
Replace m_halfvoice with m_customprefix
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12503 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_halfvoice.cpp')
-rw-r--r--src/modules/m_halfvoice.cpp102
1 files changed, 0 insertions, 102 deletions
diff --git a/src/modules/m_halfvoice.cpp b/src/modules/m_halfvoice.cpp
deleted file mode 100644
index c961d7c88..000000000
--- a/src/modules/m_halfvoice.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
- *
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
- *
- * This program is free but copyrighted software; see
- * the file COPYING for details.
- *
- * ---------------------------------------------------
- */
-
-#include "inspircd.h"
-
-/* $ModDesc: Provides channel mode +V, adding the - prefix
- * which does nothing but serves as a status symbol. */
-
-#define HALFVOICE_VALUE 1
-
-class HalfVoiceMode : public ModeHandler
-{
- public:
- HalfVoiceMode(Module* parent) : ModeHandler(parent, "halfvoice", 'V', PARAM_ALWAYS, MODETYPE_CHANNEL)
- {
- list = true;
- prefix = 0;
- levelrequired = HALFOP_VALUE;
- m_paramtype = TR_NICK;
- }
-
- void SetPrefix(char pfx) { prefix = pfx; }
-
- unsigned int GetPrefixRank()
- {
- return HALFVOICE_VALUE;
- }
-
- void RemoveMode(Channel* channel, irc::modestacker* stack)
- {
- const UserMembList* cl = channel->GetUsers();
- std::vector<std::string> mode_junk;
- mode_junk.push_back(channel->name);
- irc::modestacker modestack(false);
- std::deque<std::string> stackresult;
-
- for (UserMembCIter i = cl->begin(); i != cl->end(); i++)
- {
- if (i->second->hasMode('V'))
- {
- if (stack)
- stack->Push(this->GetModeChar(), i->first->nick);
- else
- modestack.Push(this->GetModeChar(), i->first->nick);
- }
- }
-
- if (stack)
- return;
-
- while (modestack.GetStackedLine(stackresult))
- {
- mode_junk.insert(mode_junk.end(), stackresult.begin(), stackresult.end());
- ServerInstance->SendMode(mode_junk, ServerInstance->FakeClient);
- mode_junk.erase(mode_junk.begin() + 1, mode_junk.end());
- }
- }
-
- void RemoveMode(User* user, irc::modestacker* stack)
- {
- }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
- {
- return MODEACTION_ALLOW;
- }
-};
-
-class ModuleHalfVoice : public Module
-{
- HalfVoiceMode mh;
-
- public:
- ModuleHalfVoice() : mh(this)
- {
- }
-
- void init()
- {
- ConfigTag* tag = ServerInstance->Config->ConfValue("halfvoice");
- std::string pfxchar = tag->getString("prefix", "-");
- mh.SetPrefix(pfxchar[0]);
- ServerInstance->Modules->AddService(mh);
- }
-
- Version GetVersion()
- {
- return Version("Provides a channel mode that does nothing but serve as a status symbol", VF_VENDOR);
- }
-};
-
-MODULE_INIT(ModuleHalfVoice)