summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-04-25 03:16:57 -0400
committerAdam <Adam@anope.org>2011-05-16 04:07:56 -0400
commit076ebafa1b4cc935c466c615b94eaac415af9a67 (patch)
treedbc8b0f9e7b6f954569c13ad35598f5ebe8a081d /modules/core
parent6922bd239c778e8f6f2081476ce20b9426c515ad (diff)
Moved some global functions to be member functions and misc cleanup
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/bs_bot.cpp12
-rw-r--r--modules/core/cs_akick.cpp13
-rw-r--r--modules/core/cs_info.cpp2
-rw-r--r--modules/core/enc_none.cpp4
-rw-r--r--modules/core/ns_ghost.cpp2
-rw-r--r--modules/core/os_noop.cpp2
-rw-r--r--modules/core/os_session.cpp2
7 files changed, 20 insertions, 17 deletions
diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp
index 64413b5f0..c7a898dc1 100644
--- a/modules/core/bs_bot.cpp
+++ b/modules/core/bs_bot.cpp
@@ -224,16 +224,16 @@ class CommandBSBot : public Command
return MOD_CONT;
}
- /* The new nick is really different, so we remove the Q line for
- the old nick. */
+ /* The new nick is really different, so we remove the Q line for the old nick. */
if (ircd->sqline)
{
XLine x(bi->nick);
ircdproto->SendSQLineDel(&x);
}
- /* We check whether user with this nick is online, and kill it if so */
- EnforceQlinedNick(nick, Config->s_BotServ);
+ /* Add a Q line for the new nick */
+ XLine x(nick, "Reserved for services");
+ ircdproto->SendSQLine(NULL, &x);
}
if (!user.empty())
@@ -241,8 +241,6 @@ class CommandBSBot : public Command
else
{
ircdproto->SendChangeBotNick(bi, nick);
- XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(NULL, &x);
}
if (!nick.equals_cs(bi->nick))
@@ -258,8 +256,6 @@ class CommandBSBot : public Command
if (!user.empty())
{
ircdproto->SendClientIntroduction(bi, ircd->pseudoclient_mode);
- XLine x(bi->nick, "Reserved for services");
- ircdproto->SendSQLine(NULL, &x);
bi->RejoinAll();
}
diff --git a/modules/core/cs_akick.cpp b/modules/core/cs_akick.cpp
index e168bdb67..3aafbc537 100644
--- a/modules/core/cs_akick.cpp
+++ b/modules/core/cs_akick.cpp
@@ -192,10 +192,17 @@ class CommandCSAKick : public Command
}
/* Check excepts BEFORE we get this far */
- if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted_mask(ci, mask))
+ if (ci->c)
{
- source.Reply(_(CHAN_EXCEPTED), mask.c_str(), ci->name.c_str());
- return;
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList(CMODE_EXCEPT);
+ for (; modes.first != modes.second; ++modes.first)
+ {
+ if (Anope::Match(modes.first->second, mask))
+ {
+ source.Reply(_(CHAN_EXCEPTED), mask.c_str(), ci->name.c_str());
+ return;
+ }
+ }
}
/* Check whether target nick has equal/higher access
diff --git a/modules/core/cs_info.cpp b/modules/core/cs_info.cpp
index 19823004d..a899c2911 100644
--- a/modules/core/cs_info.cpp
+++ b/modules/core/cs_info.cpp
@@ -100,7 +100,7 @@ class CommandCSInfo : public Command
CheckOptStr(optbuf, CI_NO_EXPIRE, _("No expire"), ci, u->Account());
source.Reply(_(NICK_INFO_OPTIONS), optbuf.empty() ? _("None") : optbuf.c_str());
- source.Reply(_(" Mode lock: %s"), get_mlock_modes(ci, 1).c_str());
+ source.Reply(_(" Mode lock: %s"), ci->GetMLockAsString(true).c_str());
if (!ci->HasFlag(CI_NO_EXPIRE))
source.Reply(_(" Expires on: %s"), do_strftime(ci->last_used + Config->CSExpire).c_str());
diff --git a/modules/core/enc_none.cpp b/modules/core/enc_none.cpp
index c1b403235..9f6b7ff72 100644
--- a/modules/core/enc_none.cpp
+++ b/modules/core/enc_none.cpp
@@ -25,7 +25,7 @@ class ENone : public Module
{
Anope::string buf = "plain:";
Anope::string cpass;
- b64_encode(src, cpass);
+ Anope::B64Encode(src, cpass);
buf += cpass;
Log(LOG_DEBUG_2) << "(enc_none) hashed password from [" << src << "] to [" << buf << "]";
dest = buf;
@@ -38,7 +38,7 @@ class ENone : public Module
return EVENT_CONTINUE;
size_t pos = src.find(':');
Anope::string buf = src.substr(pos + 1);
- b64_decode(buf, dest);
+ Anope::B64Decode(buf, dest);
return EVENT_ALLOW;
}
diff --git a/modules/core/ns_ghost.cpp b/modules/core/ns_ghost.cpp
index d22b82472..955f25de7 100644
--- a/modules/core/ns_ghost.cpp
+++ b/modules/core/ns_ghost.cpp
@@ -69,7 +69,7 @@ class CommandNSGhost : public Command
{
Log(LOG_COMMAND, u, this) << "for " << nick;
Anope::string buf = "GHOST command used by " + u->nick;
- kill_user(Config->s_NickServ, user, buf);
+ user->Kill(Config->s_NickServ, buf);
source.Reply(_("Ghost with your nick has been killed."), nick.c_str());
}
}
diff --git a/modules/core/os_noop.cpp b/modules/core/os_noop.cpp
index e86508d49..af25b900f 100644
--- a/modules/core/os_noop.cpp
+++ b/modules/core/os_noop.cpp
@@ -46,7 +46,7 @@ class CommandOSNOOP : public Command
++it;
if (u2 && u2->HasMode(UMODE_OPER) && Anope::Match(u2->server->GetName(), server, true))
- kill_user(Config->s_OperServ, u2, reason);
+ u2->Kill(Config->s_OperServ, reason);
}
}
else if (cmd.equals_ci("REVOKE"))
diff --git a/modules/core/os_session.cpp b/modules/core/os_session.cpp
index 4a3695796..dd93e555b 100644
--- a/modules/core/os_session.cpp
+++ b/modules/core/os_session.cpp
@@ -606,7 +606,7 @@ class OSSession : public Module
if (!Config->SessionLimitDetailsLoc.empty())
u->SendMessage(operserv->Bot(), "%s", Config->SessionLimitDetailsLoc.c_str());
- kill_user(Config->s_OperServ, u, "Session limit exceeded");
+ u->Kill(Config->s_OperServ, "Session limit exceeded");
++session->hits;
if (Config->MaxSessionKill && session->hits >= Config->MaxSessionKill && SGLine)