summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_banredirect.cpp4
-rw-r--r--src/modules/m_cban.cpp6
-rw-r--r--src/modules/m_chanprotect.cpp4
-rw-r--r--src/modules/m_conn_join.cpp2
-rw-r--r--src/modules/m_cycle.cpp2
-rw-r--r--src/modules/m_denychans.cpp8
-rw-r--r--src/modules/m_joinflood.cpp2
-rw-r--r--src/modules/m_kicknorejoin.cpp2
-rw-r--r--src/modules/m_ojoin.cpp2
-rw-r--r--src/modules/m_operchans.cpp2
-rw-r--r--src/modules/m_operprefix.cpp2
-rw-r--r--src/modules/m_override.cpp18
-rw-r--r--src/modules/m_redirect.cpp11
-rw-r--r--src/modules/m_regonlycreate.cpp4
-rw-r--r--src/modules/m_restrictchans.cpp7
-rw-r--r--src/modules/m_sajoin.cpp2
-rw-r--r--src/modules/m_services_account.cpp2
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp2
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp2
-rw-r--r--src/modules/m_sslmodes.cpp4
20 files changed, 43 insertions, 45 deletions
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index ee52a5cfb..1a5126e61 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -267,7 +267,7 @@ class ModuleBanRedirect : public Module
}
}
- virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ virtual ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string &privs, const std::string &keygiven)
{
if (chan)
{
@@ -323,7 +323,7 @@ class ModuleBanRedirect : public Module
user->WriteNumeric(474, "%s %s :Cannot join channel (You are banned)", user->nick.c_str(), chan->name.c_str());
user->WriteNumeric(470, "%s %s %s :You are banned from this channel, so you are automatically transfered to the redirected channel.", user->nick.c_str(), chan->name.c_str(), redir->targetchan.c_str());
nofollow = true;
- Channel::JoinUser(user, redir->targetchan.c_str(), false, "", false, ServerInstance->Time());
+ Channel::JoinUser(user, redir->targetchan, false, "", false, ServerInstance->Time());
nofollow = false;
return MOD_RES_DENY;
}
diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp
index c779f02df..6f7d576ea 100644
--- a/src/modules/m_cban.cpp
+++ b/src/modules/m_cban.cpp
@@ -188,16 +188,16 @@ class ModuleCBan : public Module
return MOD_RES_DENY;
}
- virtual ModResult OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
XLine *rl = ServerInstance->XLines->MatchesLine("CBAN", cname);
if (rl)
{
// Channel is banned.
- user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick.c_str(), cname, rl->reason.c_str());
+ user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick.c_str(), cname.c_str(), rl->reason.c_str());
ServerInstance->SNO->WriteGlobalSno('a', "%s tried to join %s which is CBANed (%s)",
- user->nick.c_str(), cname, rl->reason.c_str());
+ user->nick.c_str(), cname.c_str(), rl->reason.c_str());
return MOD_RES_DENY;
}
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp
index affd0c8d6..09364fb32 100644
--- a/src/modules/m_chanprotect.cpp
+++ b/src/modules/m_chanprotect.cpp
@@ -138,7 +138,7 @@ class ChanFounder : public ModeHandler, public FounderProtectBase
void RemoveMode(User* user, irc::modestacker* stack)
{
}
-
+
ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding)
{
User* theuser = ServerInstance->FindNick(parameter);
@@ -288,7 +288,7 @@ class ModuleChanProtect : public Module
settings.DeprivOthers = tag->getBool("deprotectothers", true);
}
- ModResult OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
// if the user is the first user into the channel, mark them as the founder, but only if
// the config option for it is set
diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp
index 6b13ab1aa..6f9679eb7 100644
--- a/src/modules/m_conn_join.cpp
+++ b/src/modules/m_conn_join.cpp
@@ -57,7 +57,7 @@ class ModuleConnJoin : public Module
while (chans.GetToken(chan))
{
if (ServerInstance->IsChannel(chan.c_str(), ServerInstance->Config->Limits.ChanMax))
- Channel::JoinUser(user, chan.c_str(), false, "", false, ServerInstance->Time());
+ Channel::JoinUser(user, chan, false, "", false, ServerInstance->Time());
}
}
};
diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp
index 383e7b5a2..4aa8e9c20 100644
--- a/src/modules/m_cycle.cpp
+++ b/src/modules/m_cycle.cpp
@@ -66,7 +66,7 @@ class CommandCycle : public Command
channel->PartUser(user, reason);
- Channel::JoinUser(user, parameters[0].c_str(), true, "", false, ServerInstance->Time());
+ Channel::JoinUser(user, parameters[0], true, "", false, ServerInstance->Time());
}
return CMD_SUCCESS;
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index e774e92c8..a96597ace 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -87,7 +87,7 @@ class ModuleDenyChannels : public Module
}
- virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
ConfigTagList tags = ServerInstance->Config->ConfTags("badchan");
for (ConfigIter j = tags.first; j != tags.second; ++j)
@@ -118,13 +118,13 @@ class ModuleDenyChannels : public Module
Channel *newchan = ServerInstance->FindChan(redirect);
if ((!newchan) || (!(newchan->IsModeSet('L'))))
{
- user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname,cname,redirect.c_str(), reason.c_str());
- Channel::JoinUser(user,redirect.c_str(),false,"",false,ServerInstance->Time());
+ user->WriteNumeric(926, "%s %s :Channel %s is forbidden, redirecting to %s: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),redirect.c_str(), reason.c_str());
+ Channel::JoinUser(user, redirect, false, "", false, ServerInstance->Time());
return MOD_RES_DENY;
}
}
- user->WriteNumeric(926, "%s %s :Channel %s is forbidden: %s",user->nick.c_str(),cname,cname,reason.c_str());
+ user->WriteNumeric(926, "%s %s :Channel %s is forbidden: %s",user->nick.c_str(),cname.c_str(),cname.c_str(),reason.c_str());
return MOD_RES_DENY;
}
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 0c68da1fb..8fcb2dd12 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -208,7 +208,7 @@ class ModuleJoinFlood : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (chan)
{
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 836f92e6c..8ed472d31 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -74,7 +74,7 @@ public:
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (chan)
{
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 8f8d3ca90..207be2bb5 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -193,7 +193,7 @@ class ModuleOjoin : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (mycommand.active)
{
diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp
index ca948d95b..e0423886f 100644
--- a/src/modules/m_operchans.cpp
+++ b/src/modules/m_operchans.cpp
@@ -49,7 +49,7 @@ class ModuleOperChans : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (chan && chan->IsModeSet('O') && !IS_OPER(user))
{
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index b6e6b893b..b0ca38555 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -97,7 +97,7 @@ class ModuleOperPrefixMode : public Module
mw_added = ServerInstance->Modes->AddModeWatcher(&hideoperwatcher);
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string& privs, const std::string& keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
/* The user may have the +H umode on himself, but +H does not necessarily correspond
* to the +H of m_hideoper.
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 1d9447fc4..62fdfc8c9 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -116,7 +116,7 @@ class ModuleOverride : public Module
return MOD_RES_PASSTHRU;
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (IS_LOCAL(user) && IS_OPER(user))
{
@@ -135,8 +135,8 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass invite-only", cname, user->nick.c_str());
- ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +i on "+std::string(cname));
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass invite-only", cname.c_str(), user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +i on " + cname);
}
return MOD_RES_ALLOW;
}
@@ -151,8 +151,8 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel key", cname, user->nick.c_str());
- ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +k on "+std::string(cname));
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel key", cname.c_str(), user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +k on " + cname);
return MOD_RES_ALLOW;
}
@@ -166,8 +166,8 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel limit", cname, user->nick.c_str());
- ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +l on "+std::string(cname));
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass the channel limit", cname.c_str(), user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('v', user->nick+" used oper override to bypass +l on " + cname);
return MOD_RES_ALLOW;
}
@@ -181,8 +181,8 @@ class ModuleOverride : public Module
}
if (NoisyOverride)
- chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass channel ban", cname, user->nick.c_str());
- ServerInstance->SNO->WriteGlobalSno('v',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname);
+ chan->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s used oper override to bypass channel ban", cname.c_str(), user->nick.c_str());
+ ServerInstance->SNO->WriteGlobalSno('v',"%s used oper override to bypass channel ban on %s", user->nick.c_str(), cname.c_str());
return MOD_RES_ALLOW;
}
}
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 26d6b162b..8076bb2a1 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -131,7 +131,7 @@ class ModuleRedirect : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (chan)
{
@@ -146,21 +146,20 @@ class ModuleRedirect : public Module
destchan = ServerInstance->FindChan(channel);
if (destchan && destchan->IsModeSet('L'))
{
- user->WriteNumeric(470, "%s %s * :You may not join this channel. A redirect is set, but you may not be redirected as it is a circular loop.", user->nick.c_str(), cname);
+ user->WriteNumeric(470, "%s %s * :You may not join this channel. A redirect is set, but you may not be redirected as it is a circular loop.", user->nick.c_str(), cname.c_str());
return MOD_RES_DENY;
}
/* We check the bool value here to make sure we have it enabled, if we don't then
usermode +L might be assigned to something else. */
if (UseUsermode && user->IsModeSet('L'))
{
- user->WriteNumeric(470, "%s %s %s :Force redirection stopped.",
- user->nick.c_str(), cname, channel.c_str());
+ user->WriteNumeric(470, "%s %s %s :Force redirection stopped.", user->nick.c_str(), cname.c_str(), channel.c_str());
return MOD_RES_DENY;
}
else
{
- user->WriteNumeric(470, "%s %s %s :You may not join this channel, so you are automatically being transferred to the redirect channel.", user->nick.c_str(), cname, channel.c_str());
- Channel::JoinUser(user, channel.c_str(), false, "", false, ServerInstance->Time());
+ user->WriteNumeric(470, "%s %s %s :You may not join this channel, so you are automatically being transferred to the redirect channel.", user->nick.c_str(), cname.c_str(), channel.c_str());
+ Channel::JoinUser(user, channel, false, "", false, ServerInstance->Time());
return MOD_RES_DENY;
}
}
diff --git a/src/modules/m_regonlycreate.cpp b/src/modules/m_regonlycreate.cpp
index 61f94c0bd..93f88fe30 100644
--- a/src/modules/m_regonlycreate.cpp
+++ b/src/modules/m_regonlycreate.cpp
@@ -34,7 +34,7 @@ class ModuleRegOnlyCreate : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (chan)
return MOD_RES_PASSTHRU;
@@ -50,7 +50,7 @@ class ModuleRegOnlyCreate : public Module
return MOD_RES_PASSTHRU;
// XXX. there may be a better numeric for this..
- user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must have a registered nickname to create a new channel", user->nick.c_str(), cname);
+ user->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :You must have a registered nickname to create a new channel", user->nick.c_str(), cname.c_str());
return MOD_RES_DENY;
}
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index c76b0e79f..d720c7b5f 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -53,10 +53,9 @@ class ModuleRestrictChans : public Module
ReadConfig();
}
-
- virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
- irc::string x = cname;
+ irc::string x(cname.c_str());
if (!IS_LOCAL(user))
return MOD_RES_PASSTHRU;
@@ -66,7 +65,7 @@ class ModuleRestrictChans : public Module
// user is not an oper and its not in the allow list
if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
{
- user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
+ user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname.c_str());
return MOD_RES_DENY;
}
}
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 932b564fa..32ebf96ac 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -58,7 +58,7 @@ class CommandSajoin : public Command
*/
if (IS_LOCAL(dest))
{
- Channel::JoinUser(dest, parameters[1].c_str(), true, "", false, ServerInstance->Time());
+ Channel::JoinUser(dest, parameters[1], true, "", false, ServerInstance->Time());
/* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propagate */
Channel* n = ServerInstance->FindChan(parameters[1]);
if (n)
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 50e2c76a6..6dd042ea6 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -245,7 +245,7 @@ class ModuleServicesAccount : public Module
return OnUserPreMessage(user, dest, target_type, text, status, exempt_list);
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if (!IS_LOCAL(user))
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index c0475613a..a90c62924 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -177,7 +177,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
modestack.Push(*x, who->nick);
- Channel::JoinUser(who, channel.c_str(), true, "", route_back_again->bursting, TS);
+ Channel::JoinUser(who, channel, true, "", route_back_again->bursting, TS);
}
else
{
diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp
index 416502369..f1f6b7cfd 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -41,7 +41,7 @@ CmdResult CommandSVSJoin::Handle(const std::vector<std::string>& parameters, Use
/* only join if it's local, otherwise just pass it on! */
if (IS_LOCAL(u))
- Channel::JoinUser(u, parameters[1].c_str(), false, "", false, ServerInstance->Time());
+ Channel::JoinUser(u, parameters[1], false, "", false, ServerInstance->Time());
return CMD_SUCCESS;
}
diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp
index c81c74207..880d40097 100644
--- a/src/modules/m_sslmodes.cpp
+++ b/src/modules/m_sslmodes.cpp
@@ -92,7 +92,7 @@ class ModuleSSLModes : public Module
ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
- ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
if(chan && chan->IsModeSet('z'))
{
@@ -106,7 +106,7 @@ class ModuleSSLModes : public Module
else
{
// Deny
- user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick.c_str(), cname);
+ user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick.c_str(), cname.c_str());
return MOD_RES_DENY;
}
}