summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-07-15 00:20:28 +0200
committerattilamolnar <attilamolnar@hush.com>2013-07-19 19:40:02 +0200
commit5288eb159451aea53168c1a812a72594801f6421 (patch)
treef8b21dc166a573796c87d67de63e815e3ccb9d66 /src
parentac55270a082e6d8f5332fa939960553bac8decae (diff)
Seperate ModeReference into ChanModeReference and UserModeReference
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp2
-rw-r--r--src/configreader.cpp2
-rw-r--r--src/modules.cpp11
-rw-r--r--src/modules/m_banredirect.cpp2
-rw-r--r--src/modules/m_check.cpp2
-rw-r--r--src/modules/m_spanningtree/netburst.cpp2
6 files changed, 12 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 4b701cc3c..0cf05f75d 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -28,7 +28,7 @@
#include <cstdarg>
#include "mode.h"
-static ModeReference ban(NULL, "ban");
+static ChanModeReference ban(NULL, "ban");
Channel::Channel(const std::string &cname, time_t ts)
{
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 5c70a9e83..b8c54bef9 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -825,7 +825,7 @@ void ConfigReaderThread::Finish()
*/
ServerInstance->XLines->CheckELines();
ServerInstance->XLines->ApplyLines();
- ModeReference ban(NULL, "ban");
+ ChanModeReference ban(NULL, "ban");
static_cast<ListModeBase*>(*ban)->DoRehash();
Config->ApplyDisabledCommands(Config->DisabledCommands);
User* user = ServerInstance->FindNick(TheUserUID);
diff --git a/src/modules.cpp b/src/modules.cpp
index 58a77faff..ca312c4a5 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -415,11 +415,14 @@ void ModuleManager::AddService(ServiceProvider& item)
throw ModuleException("Command "+std::string(item.name)+" already exists.");
return;
case SERVICE_MODE:
- if (!ServerInstance->Modes->AddMode(static_cast<ModeHandler*>(&item)))
+ {
+ ModeHandler* mh = static_cast<ModeHandler*>(&item);
+ if (!ServerInstance->Modes->AddMode(mh))
throw ModuleException("Mode "+std::string(item.name)+" already exists.");
- DataProviders.insert(std::make_pair("mode/" + item.name, &item));
+ DataProviders.insert(std::make_pair((mh->GetModeType() == MODETYPE_CHANNEL ? "mode/" : "umode/") + item.name, &item));
dynamic_reference_base::reset_all();
return;
+ }
case SERVICE_METADATA:
if (!ServerInstance->Extensions.Register(static_cast<ExtensionItem*>(&item)))
throw ModuleException("Extension " + std::string(item.name) + " already exists.");
@@ -427,8 +430,8 @@ void ModuleManager::AddService(ServiceProvider& item)
case SERVICE_DATA:
case SERVICE_IOHOOK:
{
- if (item.name.substr(0, 5) == "mode/")
- throw ModuleException("The \"mode/\" service name prefix is reserved.");
+ if ((item.name.substr(0, 5) == "mode/") || (item.name.substr(0, 6) == "umode/"))
+ throw ModuleException("The \"mode/\" and the \"umode\" service name prefixes are reserved.");
DataProviders.insert(std::make_pair(item.name, &item));
std::string::size_type slash = item.name.find('/');
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index a772794ab..496b0c2c9 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -44,7 +44,7 @@ typedef std::vector<BanRedirectEntry> BanRedirectList;
class BanRedirect : public ModeWatcher
{
- ModeReference ban;
+ ChanModeReference ban;
public:
SimpleExtItem<BanRedirectList> extItem;
BanRedirect(Module* parent)
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 562a9f661..97d747c5c 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -27,7 +27,7 @@
*/
class CommandCheck : public Command
{
- ModeReference ban;
+ ChanModeReference ban;
public:
CommandCheck(Module* parent)
: Command(parent,"CHECK", 1)
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp
index 89c8046f5..39056b1fe 100644
--- a/src/modules/m_spanningtree/netburst.cpp
+++ b/src/modules/m_spanningtree/netburst.cpp
@@ -108,7 +108,7 @@ void TreeSocket::SendFJoins(Channel* c)
}
this->WriteLine(line);
- ModeReference ban(NULL, "ban");
+ ChanModeReference ban(NULL, "ban");
static_cast<ListModeBase*>(*ban)->DoSyncChannel(c, Utils->Creator, this);
}