summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-01-02 18:36:00 +0100
committerattilamolnar <attilamolnar@hush.com>2013-01-02 18:36:00 +0100
commitd0aa0fab53653ed86da9773c96acaa20021f0003 (patch)
tree6783e5879fe22804943e48d455c442258ad1062d
parenta0eeadff239a26fc6e3be84b50090ce5f52d9c57 (diff)
m_banredirect Remove unnecessary hooks, cleanup
- Remove prioritization before m_banexception, it doesn't even hook OnUserPreJoin - Remove OnChannelDelete handler: nothing to do in that case, our extension item is automatically freed - Remove empty OnRehash handler
-rw-r--r--src/modules/m_banredirect.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 95aff080a..c2dff9126 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -139,7 +139,7 @@ class BanRedirect : public ModeWatcher
return false;
}
- Channel *c = ServerInstance->FindChan(mask[CHAN].c_str());
+ Channel *c = ServerInstance->FindChan(mask[CHAN]);
if (!c)
{
source->WriteNumeric(690, "%s :Target channel %s must exist to be set as a redirect.",source->nick.c_str(),mask[CHAN].c_str());
@@ -169,7 +169,7 @@ class BanRedirect : public ModeWatcher
}
/* Here 'param' doesn't have the channel on it yet */
- redirects->push_back(BanRedirectEntry(mask[CHAN].c_str(), param.c_str()));
+ redirects->push_back(BanRedirectEntry(mask[CHAN], param));
/* Now it does */
param.append(mask[CHAN]);
@@ -227,18 +227,11 @@ class ModuleBanRedirect : public Module
if(!ServerInstance->Modes->AddModeWatcher(&re))
throw ModuleException("Could not add mode watcher");
- OnRehash(NULL);
-
ServerInstance->Modules->AddService(re.extItem);
- Implementation list[] = { I_OnRehash, I_OnUserPreJoin, I_OnChannelDelete };
+ Implementation list[] = { I_OnUserPreJoin };
ServerInstance->Modules->Attach(list, this, sizeof(list)/sizeof(Implementation));
}
- virtual void OnChannelDelete(Channel* chan)
- {
- OnCleanup(TYPE_CHANNEL, chan);
- }
-
virtual void OnCleanup(int target_type, void* item)
{
if(target_type == TYPE_CHANNEL)
@@ -274,10 +267,6 @@ class ModuleBanRedirect : public Module
}
}
- virtual void OnRehash(User* user)
- {
- }
-
virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
{
/* This prevents recursion when a user sets multiple ban redirects in a chain
@@ -353,12 +342,6 @@ class ModuleBanRedirect : public Module
{
return Version("Allows an extended ban (+b) syntax redirecting banned users to another channel", VF_COMMON|VF_VENDOR);
}
-
- void Prioritize()
- {
- Module* banex = ServerInstance->Modules->Find("m_banexception.so");
- ServerInstance->Modules->SetPriority(this, I_OnUserPreJoin, PRIORITY_BEFORE, &banex);
- }
};
MODULE_INIT(ModuleBanRedirect)