summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp2
-rw-r--r--src/modules/m_banexception.cpp48
-rw-r--r--src/modules/m_override.cpp2
-rw-r--r--src/modules/m_silence.cpp9
4 files changed, 23 insertions, 38 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 5fea846da..065b9184e 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -181,7 +181,7 @@ class ModuleAlias : public Module
}
// fcommands are only for local users. Spanningtree will send them back out as their original cmd.
- if (!user || !IS_LOCAL(user))
+ if (!IS_LOCAL(user))
{
return;
}
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp
index b10ed3604..b29b39747 100644
--- a/src/modules/m_banexception.cpp
+++ b/src/modules/m_banexception.cpp
@@ -58,23 +58,19 @@ class ModuleBanException : public Module
ModResult OnExtBanCheck(User *user, Channel *chan, char type) CXX11_OVERRIDE
{
- if (chan != NULL)
- {
- ListModeBase::ModeList *list = be.GetList(chan);
+ ListModeBase::ModeList* list = be.GetList(chan);
+ if (!list)
+ return MOD_RES_PASSTHRU;
- if (!list)
- return MOD_RES_PASSTHRU;
+ for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
+ {
+ if (it->mask[0] != type || it->mask[1] != ':')
+ continue;
- for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
+ if (chan->CheckBan(user, it->mask.substr(2)))
{
- if (it->mask[0] != type || it->mask[1] != ':')
- continue;
-
- if (chan->CheckBan(user, it->mask.substr(2)))
- {
- // They match an entry on the list, so let them pass this.
- return MOD_RES_ALLOW;
- }
+ // They match an entry on the list, so let them pass this.
+ return MOD_RES_ALLOW;
}
}
@@ -83,23 +79,19 @@ class ModuleBanException : public Module
ModResult OnCheckChannelBan(User* user, Channel* chan) CXX11_OVERRIDE
{
- if (chan)
+ ListModeBase::ModeList* list = be.GetList(chan);
+ if (!list)
{
- ListModeBase::ModeList *list = be.GetList(chan);
-
- if (!list)
- {
- // No list, proceed normally
- return MOD_RES_PASSTHRU;
- }
+ // No list, proceed normally
+ return MOD_RES_PASSTHRU;
+ }
- for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
+ for (ListModeBase::ModeList::iterator it = list->begin(); it != list->end(); it++)
+ {
+ if (chan->CheckBan(user, it->mask))
{
- if (chan->CheckBan(user, it->mask))
- {
- // They match an entry on the list, so let them in.
- return MOD_RES_ALLOW;
- }
+ // They match an entry on the list, so let them in.
+ return MOD_RES_ALLOW;
}
}
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 7e0d796d7..ce9ea17e2 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -103,7 +103,7 @@ class ModuleOverride : public Module
ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters) CXX11_OVERRIDE
{
- if (!source || !channel)
+ if (!channel)
return MOD_RES_PASSTHRU;
if (!source->IsOper() || !IS_LOCAL(source))
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 03d2b7953..fe7418621 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -338,10 +338,7 @@ class ModuleSilence : public Module
else if (target_type == TYPE_CHANNEL)
{
Channel* chan = (Channel*)dest;
- if (chan)
- {
- this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
- }
+ this->OnBuildExemptList(msgtype, chan, user, status, exempt_list, "");
}
return MOD_RES_PASSTHRU;
}
@@ -353,10 +350,6 @@ class ModuleSilence : public Module
ModResult MatchPattern(User* dest, User* source, int pattern)
{
- /* Server source */
- if (!source || !dest)
- return MOD_RES_ALLOW;
-
silencelist* sl = cmdsilence.ext.get(dest);
if (sl)
{