summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h2
-rw-r--r--src/commands.cpp2
-rw-r--r--src/modules.cpp2
-rw-r--r--src/modules/m_override.cpp49
4 files changed, 29 insertions, 26 deletions
diff --git a/include/modules.h b/include/modules.h
index 978a9a4a6..caea6e421 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -249,7 +249,7 @@ class Module : public classbase
virtual void OnWhois(userrec* source, userrec* dest);
/** Called whenever a user is about to invite another user into a channel, before any processing is done.
- * Returning any nonzero value from this function stops the process immediately, causing no
+ * Returning 1 from this function stops the process immediately, causing no
* output to be sent to the user by the core. If you do this you must produce your own numerics,
* notices etc. This is useful for modules which may want to filter invites to channels.
*/
diff --git a/src/commands.cpp b/src/commands.cpp
index ffa09156b..5b3c14f98 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -435,7 +435,7 @@ void handle_invite(char **parameters, int pcnt, userrec *user)
int MOD_RESULT = 0;
FOREACH_RESULT(OnUserPreInvite(user,u,c));
if (MOD_RESULT == 1) {
- return NULL;
+ return;
}
u->InviteTo(c->name);
diff --git a/src/modules.cpp b/src/modules.cpp
index a2f8a4413..7477fe518 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -310,7 +310,7 @@ Version Module::GetVersion() { return Version(1,0,0,0); }
void Module::OnOper(userrec* user) { };
void Module::OnInfo(userrec* user) { };
void Module::OnWhois(userrec* source, userrec* dest) { };
-int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0 };
+int Module::OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) { return 0; };
int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text) { return 0; };
int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text) { return 0; };
int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; };
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 40508c5ef..2c3adfa9a 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -57,31 +57,34 @@ class ModuleOverride : public Module
{
if (strchr(source->modes,'o'))
{
- if ((Srv->ChanMode(source,channel) != "%") && (Srv->ChanMode(source,channel) != "@"))
+ if ((Srv) && (source) && (channel))
{
- switch (access_type)
+ if ((Srv->ChanMode(source,channel) != "%") && (Srv->ChanMode(source,channel) != "@"))
{
- case AC_KICK:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_DEOP:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Deopped "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_OP:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Opped "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_VOICE:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Voiced "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_DEVOICE:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Devoiced "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_HALFOP:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Halfopped "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
- case AC_DEHALFOP:
- Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Dehalfopped "+std::string(dest->nick)+" on "+std::string(channel->name));
- break;
+ switch (access_type)
+ {
+ case AC_KICK:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Kicked "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_DEOP:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Deopped "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_OP:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Opped "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_VOICE:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Voiced "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_DEVOICE:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Devoiced "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_HALFOP:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Halfopped "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ case AC_DEHALFOP:
+ Srv->SendOpers("*** NOTICE: "+std::string(source->nick)+" Override-Dehalfopped "+std::string(dest->nick)+" on "+std::string(channel->name));
+ break;
+ }
}
}
return ACR_ALLOW;