summaryrefslogtreecommitdiff
path: root/src/users.cpp
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 /src/users.cpp
parent6922bd239c778e8f6f2081476ce20b9426c515ad (diff)
Moved some global functions to be member functions and misc cleanup
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 88ab225b6..0e986cc93 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -261,7 +261,7 @@ void User::SendMessage(BotInfo *source, Anope::string msg)
* back to call do_nick. do_nick changes the nick of the use to the new one, then calls NickAlias::OnCancel
* with the users old nick's nickalias (if there is one).
*
- * 2. Calls kill_user, which will either delete the user immediatly or kill them, wait for the QUIT,
+ * 2. Calls User::Kill, which will either delete the user immediatly or kill them, wait for the QUIT,
* then delete the user then. Users destructor then calls NickAlias::OnCancel
*
* NickAlias::OnCancel checks for NS_COLLIDED, it then does one of two things.
@@ -324,7 +324,7 @@ void User::Collide(NickAlias *na)
ircdproto->SendForceNickChange(this, guestnick, Anope::CurTime);
}
else
- kill_user(Config->s_NickServ, this, "Services nickname-enforcer kill");
+ this->Kill(Config->s_NickServ, "Services nickname-enforcer kill");
}
/** Identify the user to the Nick
@@ -711,6 +711,17 @@ bool User::IsProtected() const
return false;
}
+void User::Kill(const Anope::string &source, const Anope::string &reason)
+{
+ Anope::string real_source = source.empty() ? Config->ServerName : source;
+ Anope::string real_reason = real_source + " (" + reason + ")";
+
+ ircdproto->SendSVSKill(findbot(source), this, "%s", real_reason.c_str());
+
+ if (!ircd->quitonkill)
+ do_kill(this, real_reason);
+}
+
User *finduser(const Anope::string &nick)
{
if (isdigit(nick[0]) && ircd->ts6)
@@ -902,24 +913,6 @@ bool matches_list(Channel *c, User *user, ChannelModeName mode)
/*************************************************************************/
-/* Is the given MASK ban-excepted? */
-bool is_excepted_mask(ChannelInfo *ci, const Anope::string &mask)
-{
- if (!ci->c || !ModeManager::FindChannelModeByName(CMODE_EXCEPT))
- return false;
-
- 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))
- return true;
- }
-
- return false;
-}
-
-/*************************************************************************/
-
/* Given a user, return a mask that will most likely match any address the
* user will have from that location. For IP addresses, wildcards the
* appropriate subnet mask (e.g. 35.1.1.1 -> 35.*; 128.2.1.1 -> 128.2.*);